Zend_Pdf how to reduce the loading time of images?

123 views Asked by At

I built an pdf document which is based on database records of 2 related tables. The mastertable contains shopdata with logos. In the records I of course don't save the image itself, but only the pathinfo. The detailtable just contains meeting dates, no problems with this one.

If I start building the pdf document it takes much time. So I tried some alternatives:

  • If I limit the records to about 10 it works quite well, but it takes very long to load.
  • If I don't limit I get a timeout.
  • If I annotate the statements to try without logos it works also fine

My question is, is there some possibility like a preload, caching or something else for Zend_pdf which could help to minimize the loading time?

1

There are 1 answers

0
JamesG On BEST ANSWER

If your images contain transparent backgrounds, they will take a long time to render in Zend_Pdf. Try removing the transparent backgrounds (if possible) and see if that makes a difference. If that helps, you could use GD library or ImageMagick to replace transaparent backgrounds with white backgrounds as the logos are being added to the database.