PDF::Writer memory error

J

john sikorski

I'm trying to use PDF::Writer to generate a PDF version of a phone list
but I'm having out of memory problems. The document is formatted for 2
column output. I originally added all names (about 500) to a single
four column SimpleTable object which ran without error, albeit slow. I
then tried creating seperate tables for each letter of the alphabet,
resulting in an out of memory error. Google searches found a few
others experiencing the same problem. One suggestion was to set
split_rows=true which did prevent the error but the pdf generated was
poor, rows spilling over to the next page, column headings appearing
twice, and a few other odd problems. Does anyone know how to make this
work with PDF::Writer? Any suggestions for other Ruby PDF API's?

Thanks,

John
 
A

Austin Ziegler

I'm trying to use PDF::Writer to generate a PDF version of a phone list
but I'm having out of memory problems. The document is formatted for 2
column output. I originally added all names (about 500) to a single
four column SimpleTable object which ran without error, albeit slow. I
then tried creating seperate tables for each letter of the alphabet,
resulting in an out of memory error. Google searches found a few
others experiencing the same problem. One suggestion was to set
split_rows=true which did prevent the error but the pdf generated was
poor, rows spilling over to the next page, column headings appearing
twice, and a few other odd problems. Does anyone know how to make this
work with PDF::Writer? Any suggestions for other Ruby PDF API's?

I don't have any suggestions right now, but you may want to check the
Rails list for a post about a version of SimpleTable that doesn't use
Transaction::Simple. You'll need to ensure the pagination yourself,
but I will be reviewing SimpleTable's use of Transaction::Simple in
the future to fix this.

I'll tag this to look at it again next month when I get back to
PDF::Writer work.

-austin
 
J

john sikorski

In case anyone is interested, I found a work around for this problem.
If you manually set the table width the out of memory error does not
occur. In my case I was adding multiple tables to a page formated for
2 column output. Setting table.width=260 worked for me.

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,145
Latest member
web3PRAgeency
Top