vikrambalye / dompdf

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

DOMPDF creates a damaged PDF file #281

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Created a new test.php file in the dompdf root directory
2. test.php contains the following code:
<?php
require_once("dompdf_config.inc.php");
$html =
    '<html><body>'.
    '<p>Hello World!</p>'.
    '</body></html>';

$dompdf = new DOMPDF();
$dompdf->load_html($html);

$dompdf->render();
$dompdf->stream("hello_world.pdf");

?>
3. Executed the script

What is the expected output? What do you see instead?
Expected output is to have the PDF saved on my local file system. But instead 
of this Adobe Reader 8.2.6 gives the following error message: "There was an 
error opening this document. The file is damaged and could not be repaired."
From www/setup.php I can generate all examples with no problem. Even on the 
demo everything runs fine.

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

Please provide any additional information below.

PHP Version 5.2.13 

DOMDocument extension 20031129 

PCRE Yes 

Zlib 1.1 

MBString extension Yes 

GD Yes 

APC No. Recommended for better performances 

Original issue reported on code.google.com by deni...@gmail.com on 15 May 2011 at 8:20

GoogleCodeExporter commented 9 years ago
i have the same problem, i'm working with version 0.5.1 and Windows 7.
Additional information:
PHP Version 5.3.4

Original comment by eduseba...@gmail.com on 16 May 2011 at 3:59

GoogleCodeExporter commented 9 years ago
The PDF may have been rendered correctly but, depending on your configuration, 
some non-PDF content may have been included in the PDF source. The easiest way 
to check for this is to open your PDF in a text editor and look for things like 
strings of HTML text.

If that's not the problem, it would help to see the PDF itself.

Original comment by eclecticgeek on 16 May 2011 at 6:20

GoogleCodeExporter commented 9 years ago
@eclecticgeek you were right. I had the php code inside of an html document 
with it's headers html tags and etc. Once I leave only the php code everything 
runs fine. Thank you.

Original comment by deni...@gmail.com on 17 May 2011 at 4:47

GoogleCodeExporter commented 9 years ago
Glad you were able to resolve your issue.

Original comment by eclecticgeek on 18 May 2011 at 6:28

GoogleCodeExporter commented 9 years ago
this problem occurs when your server is not permit to write any file....so try 
to give permission to write load.html in dompdf/lib/fonts/log.htm

Original comment by sourabh....@sarvatman.com on 25 May 2012 at 9:34

GoogleCodeExporter commented 9 years ago

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