vikrambalye / dompdf

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

Problem with xmlns attribute in <html> tag #333

Closed GoogleCodeExporter closed 9 years ago

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

Add the following header to the page you are going to "print as pdf":

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>

(The most important thing is the xmlns-attribute.)

Create a PDF from that page.

What is the expected output? What do you see instead?

"xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">" is shown as 
text on top of the PDF. (See screenshot)

What version of the product are you using? On what operating system?

SVN #422; OS does not matter.

Original issue reported on code.google.com by google.2...@spamgourmet.com on 8 Aug 2011 at 2:53

Attachments:

GoogleCodeExporter commented 9 years ago
Which version of PHP/libxml/DOM are you using? I'm not seeing the same thing on 
my server (PHP 5.3.4, libxml 2.6.32, DOM API 20031129).

Can you create a simplified test document that duplicates the problem and post 
it? Also on your computer load that document into DOMPDF then use 
$dompdf->output_html() and post the results so we can see what has been loaded 
on your computer?

Original comment by eclecticgeek on 8 Aug 2011 at 5:37

GoogleCodeExporter commented 9 years ago
Can I send you an PN/Mail with a link, please? (For working example and 
extended phpinfo()) 
I will try to create a simple test.

libxml Version  2.6.26 
DOM/XML API Version     20031129 
System  Linux dehamv026.configcenter.info 2.6.26-2-xen-amd64 #1 SMP Wed Mar 10 
00:29:48 UTC 2010 x86_64 
PHP 5.2.9

Original comment by google.2...@spamgourmet.com on 10 Aug 2011 at 3:50

GoogleCodeExporter commented 9 years ago
Here's the header $dompdf->output_html() prints (only the important part):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><body>
<p>35bd

</p> xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

Original:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Original comment by google.2...@spamgourmet.com on 10 Aug 2011 at 3:55

GoogleCodeExporter commented 9 years ago
Wooops...

I found out that the problem was caused by Zend_Http_Client. I used the 
getRawBody() method to get the HTML, this added the "35bd" on top of the 
output. After changing this to getBody(), the issue is fixed.

I'm so sorry for bothering you... :(((

Please just close and forget this issue.

Original comment by google.2...@spamgourmet.com on 10 Aug 2011 at 4:02

GoogleCodeExporter commented 9 years ago
No worries. Glad it wound up being a fairly trivial fix.

Original comment by eclecticgeek on 10 Aug 2011 at 5:20

GoogleCodeExporter commented 9 years ago

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