-
-
Notifications
You must be signed in to change notification settings - Fork 647
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
Generate PDF files without embedding default PDF fonts #551
Comments
Do you guys have any update on this issue? I would love to use this feature |
The best way to get this is to get rid of Cairo (see #841), but that’s hard to do. |
Any progress since March? |
@bl-ue I think #1232 and https://github.com/CourtBouillon/pydyf should provide a path forward so this can be implemented. |
That’s right! |
Wow! Thank you for the fast response!! 🤩 We over @tldr-pages use WeasyPrint several times a day, and the PDF that contains all of our (4000?) pages is getting a little big...:smile: I'll be sure to track that issue and introduce the rest of the team to it. Again, thank you guys for your extremely fast responses!!! |
You’re welcome! I’ve read your script, and your problem is not the one described by this issue. Your problem is that fonts are embedded multiple times when pages from multiple WeasyPrint documents are put in a single PDF. Could you please open a new issue with a link to your Python script? Thank you! |
The hb_face value is different when the Pango font is different, and it causes problems when multiple Pango contexts are used (for example when pages from multiple documents are mixed). Related to #551.
@bl-ue Your problem is fixed (I hope) with the current |
Okay @liZe, wonderful! I'm sorry I never got to the issue—I got busy :) P.S. Your team is really responsive! Good choice to pick WeasyPrint! :D |
It’s probably slow, but at least it’s reliable. We can find a better solution later. Related to #551.
Here’s the result for French pages. PDF size was 3.4MB, it’s now 400kB 🎉.
❤️ |
I'm generating a few hundred PDF files with weasyprint and the total size of the PDF files starts to add up. That in turn starts pushing some other legacy systems quite badly so I'm looking for ways to reduce the final PDF size.
I noticed that proprietary PDF tools are able to "optimize" my generated PDFs which results in way smaller PDF files. Now I'm looking for ways to do achieve similar effects with WeasyPrint.
From what I can see in Evince each of my PDFs has some embedded fonts (even though I don't have any special font requirements). My hope was that I could somehow tell WeasyPrint to use Helvetica which is (AFAIK) a PDF default font which doesn't need to be embedded.
Unfortunately so far I was unable to achieve this. WeasyPrint always embeds a font. Is there any way to tell WeasyPrint it should NOT embed Helvetica/ensure only standard PDF fonts are used?
The text was updated successfully, but these errors were encountered: