Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated PDF size jumped from 2.2 -> 8MB after upgrade to 53.3 #1475

Closed
gnyers opened this issue Oct 20, 2021 · 4 comments
Closed

Generated PDF size jumped from 2.2 -> 8MB after upgrade to 53.3 #1475

gnyers opened this issue Oct 20, 2021 · 4 comments

Comments

@gnyers
Copy link

gnyers commented Oct 20, 2021

Last week I've updated my VENV to the latest WeasyPrint (v53.3) with pip. Suddenly the same document that used to be 2.2MB is now built as a 8.2.

I'm using:

$ weasyprint --version
WeasyPrint version 53.3

$ python --version
Python 3.6.12

$ head -2 /etc/os-release 
NAME="openSUSE Leap"
VERSION="15.2"

Unfortunately I don't exactly know the previous version that I've used, but I thing it was a v52.?

This example document is moderately heavy on PNG images.

@mpth
Copy link

mpth commented Oct 25, 2021

Havent worked with earlier versions a lot but coming from wkhtmltopdf it seems images can blow up the file size quite a bit.

One sample HTML document got me a PDF with less than 5MB generated with wkhtmltopdf

With Weasyprint 53.3 I got a PDF >15MB with image optimization turned on.

Anything I can do to keep file size under control when many images are used in documents?

@liZe
Copy link
Member

liZe commented Oct 26, 2021

Hello,

If you can share some examples, we’d be happy to test and see what’s wrong. This problem is probably a duplicate of #1444, with PNG images transformed into JPEG2000, causing useless extra time and extra size.

@mpth
Copy link

mpth commented Oct 26, 2021

@liZe can't share the document or the images but it is 31 small screenshots in PNG format (637 KB total file size) so it is probably related to #1444 👍

@liZe
Copy link
Member

liZe commented Oct 26, 2021

Let’s continue the discussion in #1444.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants