Don't create a new PdfReader each time you place the logo and don't call PdfWriter.freeReader().
Best Regards, Paulo Soares > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of [EMAIL PROTECTED] > Sent: Tuesday, June 22, 2004 7:22 PM > To: [EMAIL PROTECTED] > Subject: [iText-questions] File size with embedded PDF files > > Hello, > I am using iText to build PDF files that have other PDF files > embedded in them. These embedded PDF files are basically > single page Logos > that are placed at certain locations on the final PDF file. > The final PDF > file can contain from 1 to 120 pages. Each of these pages > will have the > logo files embedded on them. The location of these files is calculated > based on some data from a database. > The building of these files works out fine, however I > notice that the > final PDF filesize is way larger than the sum of the > filesizes of all the > embedded PDFs. e.g. I embed 5 PDFs on a page and the total size of all > these PDF files amounts to 330Kb. But, after adding some > tables and about > 7-8 lines of text, the size of the final PDF comes to around > 2020Kb. This > PDF consists of 1 pages, with 5 embedded PDF files and about > 7-8 lines of > text. I also embed 1 font into this file, as I am using a > custom font for 2 > lines of text in the final PDF. The font file is about 107Kb > in size. This > still leaves about 1400Kb of excess file size that I cannot explain. > The problem worsens when we start producing 40 page PDF > files. One > such file was about 69 Mb in size. This file also used about > 500Kb size > worth of embedded PDFs on each page. Which calculates to > about 20-25Mb for > the final PDF. I am still unable to explain the excess 50 Mb here. I > shudder to think of the file size when we build PDF files > with 60 or 120 > pages. The user complains of memory and performance problems > when they try > to open and print these files. > Am I missing something here, specifically with embedded > PDF files? I > have read that the resultant file size is offset by some > degree when PDF > files are embedded into another PDF file. But, I cannot > digest the fact > that the offset can be so ridiculous. Which leads me to > believe that I am > probably not doing this right. Any pointers in this regard > will be highly > appreciated. > > Thank you, > Yatin Kareer. > IT Department. > Mohawk Industries Inc. > > > > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - > digital self defense, top technical experts, no vendor pitches, > unmatched networking opportunities. Visit www.blackhat.com > _______________________________________________ > iText-questions mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/itext-questions > ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
