PDF Issues [message #976] |
Wed, 25 July 2007 04:58 |
mhchy
Messages: 9 Registered: July 2007 Location: Dhaka
|
Junior Member |
|
|
Dear AJM,
I have problem in generating PDF files. We have a lot of rows in database. Some scripts generate PDF quite smoothly and sometimes I encounter the problem of - "The file is damaged and could not be repaired". This is a major issue for my PDF report and please help me to solve this problem ASAP as I am stuck with this problem for a long time and I don't have any clue to resolve this. If you need to ask any question regarding PDF error, please mail me : mazid@mislbd.com
M.H.Chowdhury
|
|
|
|
|
|
|
Re: PDF Issues [message #981 is a reply to message #980] |
Wed, 25 July 2007 06:35 |
AJM
Messages: 2368 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
I have tried some PDF generation in both IE6 and IE7, and if 'destination' is set to 'I' (inline) it does not require that the PDF be saved to disk before it is displayed.
Does this error occur with the same data, or is it totally random?
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
Re: PDF Issues [message #983 is a reply to message #982] |
Wed, 25 July 2007 06:58 |
AJM
Messages: 2368 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
When you get the error with 4 records, does it always fail with the same 4 records? Or does it sometimes fail and sometimes work?
If it always fails with the same data, then it could be a data problem. What character sets are you using in your database? What fonts are you using in the PDF output?
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
Re: PDF Issues [message #986 is a reply to message #985] |
Wed, 25 July 2007 08:51 |
AJM
Messages: 2368 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
You are still not answering my question adequately. Do you always get an error with the same selection of records? Does the same selection sometimes work and sometimes not work?
If the same selection of records always fails, and a different selection never fails, then it would indicate that there is something peculiar about that particular selection of records, either in the data itself or the processing of that data in your code.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
Re: PDF Issues [message #995 is a reply to message #994] |
Thu, 26 July 2007 04:55 |
AJM
Messages: 2368 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
I cannot reproduce this problem in my test environment, so it is impossible for me to come up with a solution. Can you please send me a test set so that I an see what is happening for myself.
What I need is as follows:
- an sql script to create the database and load test data
- a copy of your PHP scripts
- a copy of your <subsystem>.menu_export.sql file so that I can have your subsystem appear in my menus.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
|
Re: PDF Issues [message #1012 is a reply to message #1011] |
Mon, 30 July 2007 08:56 |
AJM
Messages: 2368 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
I can offer no explanation as to why some PDFs fail in Linux but not in Windows. I use the PDF library from http://www.fpdf.org/ which uses standard PHP code and no special extensions or OS functions. It should produce the same results wherever it is run.
Is it the case that just SOME of the failed PDF files work in Windows, or is it that ALL of them work OK?
What version of Adobe PDF reader do you have installed?
What happens if you save the PDF file to disk instead of opening it in the bowser? Can you view the disk file, or is it still corrupted?
Do you have zlib compression turned ON or OFF in your web server? If you have compression turned ON can you try turning it OFF and testing those PF documents again?
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
Re: PDF Issues [message #1015 is a reply to message #1014] |
Tue, 31 July 2007 05:42 |
AJM
Messages: 2368 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
When I use the instruction the generated filename is the script name with '.php' automatically changed to '.pdf', and this works in both IE and Firefox.
If the PDF documents are generated OK from a Windows server but not OK from a Linux server then there must be something on the Linux server which is causing a corruption. It cannot be anything wrong with the code supplied by me otherwise it would not work on ANY server.
The message "PDF IS DAMAGED AND CANNOT BE REPAIRED" does not give me any clues as to what is wrong so I do not have any idea where to look to apply a fix.
If you have the same data on the Windows and Linx servers I can only suggest that you create a PDF that works on the Windows machine, a PDF that does not work on the Linux machine, and save both files to disk so that you can run a 'diff' to highlight any differences between the two files.
You may be using Adobe Acrobat 6.0 Professional, but what version of the free Adobe reader are you using? The latest version is 8. Do you have the latest Adobe plug-in installed in your browser?
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
Re: PDF Issues [message #1080 is a reply to message #1015] |
Mon, 03 September 2007 04:56 |
AJM
Messages: 2368 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
Upon investigation this problem only appears to arise when there is too much text in a cell which causes it to attempt to overflow onto the next line. I know that I found and fixed a small problem in this area a few releases ago, so it does not help that you are still using an older version (1.19.0) which does not contain this fix.
In the latest release (1.28.0) I have switched the PDF library from FPDF to TCPDF, and I understand that this has fixed your problem. Is this correct?
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|