At 12:48 PM 10/1/2004, henry watson wrote:
Currently we are building the entire document in memory (rather than writing to disk) as it is more efficient and we only need to email the resulting PDF document. The problem is that we need to generate PDF documents of this type up to 300 pages long. Currently the application runs out of memory after about 40 pages which is a document size of about 2MB. Using the above metrics a 300 page document would result in a file size of approx 12.5MB which is far too big for practical purposes.

Are there any practical approaches to managing/reducing a PDFs growth in the context that I've described above (ie. on-the-fly and in memory)?

A few things to consider...

1) If you are using fonts for your form fields OTHER than the Base14, then those fonts are getting embedded (and subset) ONCE PER PAGE - so that you'll have n copies of each, where n is the number of pages. Try to stick to the Base14, and make sure that iText isn't doing font embedding. NOTE: If you do this, your PDFs can not be used for PDF/X or PDF/A compliance.

2) PDF Enhancer (http://www.pdfenhancer.com) can be used to reduce the size of PDF documents (and optimize them in other ways). It has a command line interface (which requires files) and a COM interface (for Windows) which can use memory. We're planning a Java interface, but it's not there yet.


Leonard

---------------------------------------------------------------------------
Leonard Rosenthol                            <mailto:[EMAIL PROTECTED]>
Chief Technical Officer                      <http://www.pdfsages.com>
PDF Sages, Inc.                              215-938-7080 (voice)
                                             215-938-0880 (fax)



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to