absailesh / dompdf

Automatically exported from code.google.com/p/dompdf
0 stars 0 forks source link

Need help with javascript #558

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
See the code below

What is the expected output? What do you see instead?
Simply hide the title with javascript. This works well with html, but not in 
the rendered pdf. Why ? I don't understand. 

What version of dompdf are you using? What version of PHP? On what
operating system?
0.6, ubuntu, apache and Drupal

Please provide the HTML source code you want to convert, or any additional
information.

Here is my code :

$html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
</head>
<body>
Some HTML
<h1 id=title >A title</h1>  
<script 
type="text/javascript">document.getElementById("title").style.visibility="hidden
";
</script>
</body>
</html>';

$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf");

Original issue reported on code.google.com by BENJAMIN...@gmail.com on 6 Dec 2012 at 9:33

GoogleCodeExporter commented 9 years ago
dompdf does not support JavaScript. You'll have to look at something like 
wkhtmltopdf for that type of functionality.

Feel free to post a feature request, but we have many other things to address 
before we would even consider adding support for JS.

Original comment by eclecticgeek on 6 Dec 2012 at 4:12

GoogleCodeExporter commented 9 years ago

Original comment by eclecticgeek on 30 May 2013 at 5:16