Allowed Memory size --- exhausted

602 views
Skip to first unread message

Manny

unread,
May 10, 2011, 2:45:08 PM5/10/11
to dompdf
I am creating PDFs properly and dynamically, but when the output is
very large .. (printed html is 30 pages long) I get the allowed memory
size exhausted.. How can I prevent this?

BrianS

unread,
May 13, 2011, 2:25:44 PM5/13/11
to dom...@googlegroups.com
The simple answers:
  1. increase your PHP memory limit
  2. simplify your HTML
A little less simple, break up your document into multiple parts and render them separately. You can then use something like pdftk to put them all together.

Something more appropriate to your situation requires additional info. Which version of DOMPDF are you using? Does the document use tables extensively? What is your PHP version? PHP memory limit? Can we see the HTML?

soso

unread,
May 16, 2011, 9:56:49 AM5/16/11
to dompdf
I solved this problem (hopefully forever) by generating batches of a
few pages (or even one page) then at the end use pdftk to merge all
pages in one single pdf. Works like a charm.

soso

unread,
May 19, 2011, 10:38:28 AM5/19/11
to dompdf
By the way, generating batches of one-page multiples (one page per
request) and merging at the end is really much faster then generating
the whole pdf. Even if memory is not exhausted.

Manny

unread,
May 26, 2011, 7:44:35 AM5/26/11
to dompdf
Thank you for all the replies, I have looked into the pdftk option,
and it seems like I can not implement that in the server that I am
"hosting" at since I do not have access to root ..

Alternatives to it?

Jon Ljunggren

unread,
May 26, 2011, 8:08:34 AM5/26/11
to dom...@googlegroups.com
Hi!

I can recommend fpdf (http://www.fpdf.org/) instead of pdftk. It's a very useful pdf-class, so no need for root or command-line. I'm using it together with dompdf. I also use the FPDI (http://www.setasign.de/products/pdf-php-solutions/fpdi/) extension to merge multiple pdfs into bigger ones. It works fine. Good luck!

/Jon

--
You received this message because you are subscribed to the Google Groups "dompdf" group.
To post to this group, send email to dom...@googlegroups.com.
To unsubscribe from this group, send email to dompdf+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/dompdf?hl=en.


John Colvin

unread,
May 26, 2011, 4:47:08 PM5/26/11
to dompdf
If you know where the page breaks should be in your document, see the
discussions here:

http://groups.google.com/group/dompdf/browse_thread/thread/a39c007e4da5bde
http://code.google.com/p/dompdf/issues/detail?id=225
Reply all
Reply to author
Forward
0 new messages