Jeckky / dompdf

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

pdf file corrupt or damaged.... #418

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
i have installed dompdf v 5.0.1 with codeigniter v 1.7.3

like http://codeigniter.com/wiki/PDF_generation_using_dompdf

it was working great all of a sudden i am getting that my pdf is either corrupt 
or damaged.

my output looks like :

%PDF-1.3
%‚„œ”

1 0 obj
<< /Type /Catalog
/Outlines 2 0 R
/Pages 3 0 R
/OpenAction 8 0 R >>
endobj
2 0 obj
<< /Type /Outlines /Count 0 >>
endobj
3 0 obj
<< /Type /Pages
/Kids [6 0 R
]
/Count 1
/Resources <<
/ProcSet 4 0 R
/Font << 
/F1 9 0 R >>
>>
/MediaBox [0,000 0,000 612,000 792,000]
 >>
endobj
4 0 obj
[/PDF /Text ]
endobj
5 0 obj
<<
/Creator (DOMPDF Converter)
/CreationDate (2012-02-07)
>>
endobj
6 0 obj
<< /Type /Page
/Parent 3 0 R
/Contents 7 0 R
>>
endobj
7 0 obj
<< /Filter /FlateDecode
/Length 58 >>
stream
xú„2–100P@&ã“πúB,¿ls333Öê}7CC#Öê4çMÖê,◊

Original issue reported on code.google.com by pfzw...@gmail.com on 7 Feb 2012 at 7:04

GoogleCodeExporter commented 9 years ago
Your PDF is definitely corrupted. Is this the raw output from dompdf or did you 
open it in another application and save it? Your system configuration hasn't 
changed at all?

Original comment by eclecticgeek on 7 Feb 2012 at 10:48

GoogleCodeExporter commented 9 years ago
Issue 419 has been merged into this issue.

Original comment by eclecticgeek on 7 Feb 2012 at 10:48

GoogleCodeExporter commented 9 years ago
Based on the file you attached to issue 419 your application is writing some 
non-PDF data into the output stream. If you open the file in a text editor the 
following is at the end of the file:

controller:

Original comment by eclecticgeek on 7 Feb 2012 at 10:51

GoogleCodeExporter commented 9 years ago
Hi txs for your answer:

"If you open the file in a text editor the following is at the end of the file:"

I did that...so what am i looking for ??? and how do i fix it?

We checked our system configuration and no major changes have been taken place. 
I tried to integrate dompdf , into other websites of codeigniter i have, and 
getting the same result so i think there might be a wrong setting in 
codeigniter. 

Maybe something todo with the headers or encoding ?

I would appreciate any help

Original comment by pfzw...@gmail.com on 8 Feb 2012 at 7:57

GoogleCodeExporter commented 9 years ago
Your application is buffering content and appending it to the end of the PDF 
document. Scroll all the way to the bottom and you'll see the text 
"controller:" which should not be there. I'm not familiar with CI, so I 
couldn't say where the text is coming from. You could try adding an exit() 
statement just after streaming the PDF. This would halt processing and prevent 
anything else from slipping into the stream.

Original comment by eclecticgeek on 8 Feb 2012 at 3:51

GoogleCodeExporter commented 9 years ago
sorry i think i edited that part myself to show code examples attachted you 
will find the pdf which is corrupt and generated the way its been outputted by 
dompdf version 5.0.1 

can you tell me if anything wrong with the file i opened it myself in 
texteditor but seems fine to me. maybe you can tell me what wrong with the pdf 
and how to fix this problem. I am having a strict deadline and this deffinately 
needs to be fixed.

Are there certains setting in php or on the server that really needs to be 
on??that might cause this problem?

Original comment by pfzw...@gmail.com on 8 Feb 2012 at 9:46

Attachments:

GoogleCodeExporter commented 9 years ago
Can you try uncommenting line 2082 in dompdf/lib/class.pdf.php?

Original comment by eclecticgeek on 8 Feb 2012 at 10:05

GoogleCodeExporter commented 9 years ago
It looks like a problem with the locales, can you try to add this before you do 
"new DOMPDF" ?

setlocale(LC_NUMERIC, "C");

Original comment by fabien.menager on 8 Feb 2012 at 10:35

GoogleCodeExporter commented 9 years ago
txs fabien that worked! life saver!

Original comment by pfzw...@gmail.com on 9 Feb 2012 at 11:56

GoogleCodeExporter commented 9 years ago
Great! I'm closing the issue then (it was fixed in the previous beta)

Original comment by fabien.menager on 9 Feb 2012 at 12:58

GoogleCodeExporter commented 9 years ago

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