Ugh. Both of those files use line art to draw their text. No fonts at all, embedded or otherwise.
As Paulo said, the Graphics2D interface is significantly less than ideal. Every drawing command individually sets the color (even when the color hasn't changed). Using paths instead of fonts also greatly increases your file size... though I suppose you might be using that to avoid a font licensing issue. To get the most bang for your byte, you'd need to use the PdfContentByte (or more likely one of its kids: PdfTemplate) class directly: 1: Embedding the fonts you use means that the curves for a given character need only be included once (font data is also stored more efficiently than ascii, though compression muddies the waters there). Furthermore, fonts can be "subsetted" to only include the information for the characters/glyphs you actually use. 2: The dollar value 'pattern' you used to fill the black text could change into an actual "pattern" resource, so you'd only need to include one copy of "$25.00" instead of a couple hundred copies of all the path instructions to draw them. There are examples called "Pattern", "Patterns", and "ShadingPattern" on the "iText by Example" page: http://itextdocs.lowagie.com/tutorial/ PS: After I saved the iText.pdf file from your link, it was 416.9kb compared to 116.8kb for the FreeHEP version. Not great, but not as bad as your description either. --Mark Storer Senior Software Engineer Cardiff Software #include <disclaimer> typedef std::Disclaimer<Cardiff> DisCard; > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of CG > Sent: Sunday, August 27, 2006 4:54 PM > To: Post all your questions about iText here > Subject: Re: [iText-questions] PDF Size > > > I can't give out the 700K and 1.2M files, but I generated > some example PDFs > that illustrate the relative size differences. > > http://www.greetings2you.com/FreeHEP.pdf > http://www.greetings2you.com/iText.pdf > > I appreciate you taking the time to address my question! Thank you! > > CG > > > --- Paulo Soares <[EMAIL PROTECTED]> wrote: > > > There are many ways to generate a PDF and using the > Graphics2D interface is > > not a good one. Post a link to both PDFs and we'll be able > to tell you more. > > > > Paulo > > > > ----- Original Message ----- > > From: "CG" <[EMAIL PROTECTED]> > > To: <itext-questions@lists.sourceforge.net> > > Sent: Sunday, August 27, 2006 8:06 PM > > Subject: [iText-questions] PDF Size > > > > > > > The size of my pdfs are between 700K and 1.2Meg for a > single page pdf > > > compared > > > to 150K to 300K when the same elements are rendered using > the FreeHEP PDF > > > libs. > > > iText is faster and allows for a more predictable final > result. I'd like > > > to > > > stick with iText. I'm using the Graphics2D interface for > the layout of > > > shapes. > > > Any suggestions for reducing filesize? What details do > you need to > > > properly > > > assess what's happening? > > > > > > CG > > > > > > __________________________________________________ > > > Do You Yahoo!? > > > Tired of spam? Yahoo! Mail has the best spam protection around > > > http://mail.yahoo.com > > > > > > > -------------------------------------------------------------- > ----------- > > > Using Tomcat but need to do more? Need to support web > services, security? > > > Get stuff done quickly with pre-integrated technology to > make your job > > > easier > > > Download IBM WebSphere Application Server v.1.0.1 based > on Apache Geronimo > > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057& dat=121642 > > _______________________________________________ > > iText-questions mailing list > > iText-questions@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/itext-questions > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > iText-questions mailing list > iText-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/itext-questions > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions