printpdf icon indicating copy to clipboard operation
printpdf copied to clipboard

Compression regression

Open jannschu opened this issue 8 months ago • 1 comments

Hi,

after upgrading to 0.8.2 (I skipped some versions) I noticed that my PDFs files became 5x larger. After some investigation I found this:

https://github.com/fschutt/printpdf/blob/ccb7583b73b897c3c2ae77a4d587d909c28ced71/src/serialize.rs#L382

I manually added this line again in a local copy but this did not make a big difference. But maybe this was a debugging oversight?

I compared the generated PDFs and noticed that the older version was able to compress operations using object streams?

For my specific case I have a PDF with lots a drawing operations (rectangles, polygons). In 0.8.2 these are not compressed it seems, whereas previously this was the case. Is this correct? Is there a way to compress them also in 0.8.2?

jannschu avatar May 05 '25 13:05 jannschu

This was an oversight, yes.

fschutt avatar May 05 '25 16:05 fschutt