Jeckky / dompdf

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

script blocks in document header are not processed #392

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Pass the inner-HTML of the body of an HTML document with a <script 
type=text/php> tag inside it; or, alternatively, with the script inside the 
head-section (http://www.w3schools.com/tags/tag_head.asp).
2. Pass the above to render.

What is the expected output? What do you see instead?
Expected the script, in this case a header as per FAQ examples, to execute and 
draw the header; results: PDF produced as normal, but w/o the script executing.

What version of the product are you using? On what operating system?
OS: Linux 2.6.35.14-96.fc14.i686 / GNOME 2.32.0
DOMPDF: 0.6.0 beta2

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

Original issue reported on code.google.com by OneWinge...@gmail.com on 15 Dec 2011 at 12:25

GoogleCodeExporter commented 9 years ago
If you pass only the body content dompdf will create a new full HTML structure 
when the document is parsed. In this case dompdf will place any script blocks 
found into the header of the resulting document.

As you have noted, dompdf does not currently process script blocks in the 
document header. It may be reasonable to expect dompdf to process these script.

In the meantime, you can work around the issue by concatenating the necessary 
structure around your content before passing it to dompdf.

Original comment by eclecticgeek on 15 Dec 2011 at 10:39

GoogleCodeExporter commented 9 years ago
Thank you; I'll work around it. I was just surprised that the 
<head><script>...</script></head> didn't work because if I wanted 
headers/footers on every PDF page then putting the script in the header looked 
like a reasonable choice.

Original comment by OneWinge...@gmail.com on 16 Dec 2011 at 12:33

GoogleCodeExporter commented 9 years ago

Original comment by eclecticgeek on 24 May 2013 at 3:00