php - Issue on Registering and Using jQuery in domPDF Library -
i need load html content dynamically based on user selection print.php page using php dompdf library export html pdf. have include jquery , other js libraries html seems jquery not registering correctly (or not @ all). in following example tried simple insert text #result
using .html()
getting empty pdf on output.
<?php require_once("dompdf_config.inc.php"); $codigo= ' <!doctype html> <html> <head> </head> <body> <div id="result"></div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script> $( document ).ready(function() { $( "#result" ).html( "this test" ); }); </script> </body> </html> '; $codigo = utf8_decode($codigo); $dompdf = new dompdf(); $dompdf->load_html($codigo); ini_set("memory_limit","32m"); $dompdf->render(); $dompdf->stream("ejemplo.pdf");
can please let me know if doable or doing wrong here?
thanks
dompdf supports html+css. javascript (and jquery) not supported @ all. dompdf render content dynamically generated via javascript have capture page contents in browser , send server. use hidden form, capture relevant content document, insert textarea
field in form, submit server/dompdf rendering.
if want full browser compatibility in render you'll need @ phantomjs.
Comments
Post a Comment