PHP Developers: Why do I get an error attaching a larger than 2KB JPEG file in a pdf using ezPDF?
-
I am using ezPDF class to generate PDF in PHP. If I try to add a JPEG file with a size below 2KB, it works fine; however, with a JPEG file larger than 2KB, the whole PDF file gets corrupted. After opening the PDF file, I get "alert('file is corrupted or not repaired')".
-
Answer:
Hmmm is there an exit call in the php script after generating the pdf output? HTML could get appended to the PDF and mess it up.
Johnny Walls at Quora Visit the source
Other answers
Try it with 2 PNG files, one under 2KB, one over 2KB. If that works, the problem is in addJpegFromFile(). If not, let us know. (It's a huge file for a Quora question. That was the first point I found that could cause the problem. If that fixes it, it doesn't pay for me to analyze the rest of the class.)
Al Klein
Are you hitting the memory limit in PHP?
Bastien Koert
Related Q & A:
- Why do I get the error "A network error occured while connecting to the server?Best solution by Yahoo! Answers
- When I join any chat room why I get an error?Best solution by Yahoo! Answers
- Why do I get a message in German when I post on freecycle?Best solution by wiki.freecycle.org
- Why do I get an error message when I am trying to close Internet explorer page?Best solution by Yahoo! Answers
- Why do I get an error message when I open my address book?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.