Thank you for your help, Tilman. Now I actually try to re-use existing content streams whenever possible, and the files are much smaller.
Fabio Fabio Vassallo Product Development (CIS) Würth Phoenix S.r.l. via Kravogl 4, 39100 Bolzano T: +39 0471 564 116 F: +39 0471 564 122 Website | e-Mail | Map -----Original Message----- From: Tilman Hausherr [mailto:[email protected]] Sent: Tuesday, June 13, 2017 2:43 PM To: [email protected] Subject: Re: Size of compressed files Am 13.06.2017 um 14:16 schrieb Vassallo, Fabio: > Here we go: > https://imsva91-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=http > s%3a%2f%2fmega.nz%2f%23F%21RLZn1KYR%21ChydVBbdCzWSc1qyKJRtlg&umid=9C2A > 1928-51D6-C505-A146-A7C779DF2ADE&auth=5c4a03f01f211d2321469ecd99d2e078 > d796752e-37867e3e35629f04a114ea56f0a3e9bcb0def320 > > The PDFBox document is in two versions as I tried to optimize the size by > avoiding calls to setContentStreamFont(...) and setNonStrokingColor(...) if > not strictly necessary. > Nevertheless, as I could except, the size of compressed document changes very > little. First page of smallest PDFBox file has 127 (!) content streams, many of them empty (but Flate compressed so it costs about 29 bytes extra), most of them tiny. You can see that with PDFDebugger. The itext file has only 8 content streams. Tilman > > Fabio > > > Fabio Vassallo > Product Development (CIS) > > > Würth Phoenix S.r.l. > via Kravogl 4, 39100 Bolzano > T: +39 0471 564 116 > F: +39 0471 564 122 > Website | e-Mail | Map > > > > > -----Original Message----- > From: Tilman Hausherr [mailto:[email protected]] > Sent: Monday, June 12, 2017 5:27 PM > To: [email protected] > Subject: Re: Size of compressed files > > Am 12.06.2017 um 12:23 schrieb Vassallo, Fabio: >> Good morning. >> >> I have an issue concerning the size of generated PDF files >> >> I have generated some (almost) identical PDF files using iText and PDFBox. >> >> When uncompressed, the sizes are comparable, while if I use >> compression (in PDFBox I set to true parameter "compress" in >> constructor of PDPageContentStream), the PDFBox ones are much bigger >> (around 2 to 5 times bigger). >> >> Is it a known issue? Is there a way/workaround to have smaller sizes? >> Could I leave the files uncompressed and use a separate library to >> compress them? >> > Please upload the files to a sharehoster so that I can have a look at them. > > Tilman > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

