You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by "Vassallo, Fabio" <Fa...@wuerth-phoenix.com> on 2017/06/12 10:23:06 UTC

Size of compressed files

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?

Thank you in advance,
Fabio Vassallo


Fabio Vassallo
Product Development (CIS)

[cid:image001.png@01D18B3E.92F52E70]
Würth Phoenix S.r.l.
via Kravogl 4, 39100 Bolzano
T: +39 0471 564 116
F: +39 0471 564 122
Website<http://www.wuerth-phoenix.com/> | e-Mail<ma...@wuerth-phoenix.com> | Map<https://www.google.de/maps/place/Wuerth+Phoenix+S.R.L./@46.474192,11.33141,15z/data=!4m2!3m1!1s0x0:0x98a5db69edb2a02?hl=en>

[twitter-2]<https://twitter.com/WuerthPhoenix>  [wordpress-2] <http://www.neteye-blog.com/>   [linkedin] <https://www.linkedin.com/company/wuerth-phoenix>   [youtube] <https://www.youtube.com/user/WuerthPhoenix>   [http://feng-shui-web.net/blog2/wp-content/uploads/2016/02/xing-icon.png] <https://www.xing.com/companies/w%C3%BCrthphoenixsrl>   [facebook] <https://www.facebook.com/wuerthphoenix>


RE: Size of compressed files

Posted by "Vassallo, Fabio" <Fa...@wuerth-phoenix.com>.
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:THausherr@t-online.de] 
Sent: Tuesday, June 13, 2017 2:43 PM
To: users@pdfbox.apache.org
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:THausherr@t-online.de]
> Sent: Monday, June 12, 2017 5:27 PM
> To: users@pdfbox.apache.org
> 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: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Size of compressed files

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 13.06.2017 um 14:16 schrieb Vassallo, Fabio:
> Here we go:
> https://mega.nz/#F!RLZn1KYR!ChydVBbdCzWSc1qyKJRtlg
>
> 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:THausherr@t-online.de]
> Sent: Monday, June 12, 2017 5:27 PM
> To: users@pdfbox.apache.org
> 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: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


RE: Size of compressed files

Posted by "Vassallo, Fabio" <Fa...@wuerth-phoenix.com>.
Here we go:
https://mega.nz/#F!RLZn1KYR!ChydVBbdCzWSc1qyKJRtlg

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.

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:THausherr@t-online.de] 
Sent: Monday, June 12, 2017 5:27 PM
To: users@pdfbox.apache.org
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: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Size of compressed files

Posted by Tilman Hausherr <TH...@t-online.de>.
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