Exporting large PDFs results in corrupt pdf

(2 posts) (2 voices)
  1. I have found that exporting to PDF results in a file with the following contents.

    <b>Fatal error</b>: Allowed memory size of 33554432 bytes exhausted (tried to allocate 266 bytes) in <b>/u/www/loadstar/htdocs/mydbr/lib/external/phpExcel/PHPExcel/Shared/PDF/tcpdf.php</b> on line <b>19409</b>

    Various sites all point to php.ini having memory_limit set to low. And the accepted solutions is to double the size limit. However I do not own this server so I can not make this adjustment. Can I use set_ini(memory_limit,64MB) in some php file to allow for pdf exports?

    Kind Regards in advanced for any help.

    John Jones

  2. myDBR Team, Key Master

    Larger report will take more memory in export. There are few options how to solve this:

    To increase the memory to 96M in server side (if your server setup allows you to do so);
    - add set_ini('memory_limit','96M') to your mydbr/user/defaults.php
    - use "php_value memory_limit 96M" in your .htaccess

    To use client side PDF export and let the browser do the rendering:
    - use a browser which has PDF output directly included (like latest versions of Google Chrome)
    - add an PDF printer driver and print out the PDF's
    - if you are on a Mac, just use the built in PDF printing capability

    --
    myDBR Team


Reply

You must log in to post.