dante2010
wrote on 2012-08-16:
I am getting back the following error on PDF generation using the PHP API.
Fatal error: Uncaught exception 'PdfcrowdException' with message 'Sorry, we couldn't process your request.' in /public/_includes/pdfcrowd.php:324 Stack trace: #0 /services10/webpages/t/a/tamarackhomes.com/public/_includes/pdfcrowd.php(103): PdfCrowd->http_post('http://pdfcrowd...', 'username=xxx...', NULL) #1 /public/print_floors_generate.php(56): PdfCrowd->convertURI('http://www.tama...') #2 {main} thrown in /_includes/pdfcrowd.php on line 324
This happens about 75% of the time, with the other times the PDF generates fine. What is going on here?
This is a sample URL that is being used to generate the PDF:
http://www.tamarackhomes.com/print_floors.php?homeID=51&commID=7&blnElevation=B&blnOption=a:4:{i:0;s:1:%222%22;i:1;s:1:%226%22;i:2;s:1:%228%22;i:3;s:1:%229%22;}&blnOptionFloor=&&blnElevation_second=B&blnOption_second=N;&blnOptionFloor_second=&blnElevation_base=&blnOption_base=N;&blnOptionFloor_second=
support
wrote on 2012-08-16:
Hello,
the web page in question loads twelve high-resolution images, 1900px by 3091px each. This causes our converter to exceed its memory threshold which in turn leads to the 502 error you keep getting.
These twelve images are composed into two 500px by 750px images in the html. So, to avoid getting the error:
1/ If possible, compose the images on your end and use only the two final images in the html page. This will also significantly reduce the size of the generated PDF.
2/ Use lower resolution images.
Hope this helps.
dante2010
wrote on 2012-08-16:
Hi,
I had a feeling it was the image size causing the problems. The reason we went with higher resolution images was because using lower res versions resulted in a blurry image in the PDF. Using higher res and placing in a smaller container seemed to solve this problem.
Do you have any suggestions on how I can achieve crisp graphics when using lower res versions?
support
wrote on 2012-08-16:
The idea to use higher resolution images in order to achieve crisp graphics is fine. I would try to lower the resolution a bit though, for instance to 1000px by 1500px. In our experience using a resolution that is twice the size of the container usually yields satisfactory results.
Is it an option for you to compose the images locally and load only the two final ones (e.g. ImageMagick could be used for that)?