Re: Font embedding enlarges PDF

72 views
Skip to first unread message

BrianS

unread,
Feb 13, 2013, 6:14:49 PM2/13/13
to dom...@googlegroups.com
On Tuesday, February 12, 2013 3:34:53 AM UTC-5, Marek Lani wrote:
Hi,

I am having trouble that generated PDF is too big because of embedding the font data inside it.
I need different from fonts  that dompdf provides because fonts provided do not suport special characters of slovak language such as č or ľ.

Is there any way how to have PDF smaller than  100Kb and have mentioned letters inside it?

I was reading this https://github.com/dompdf/dompdf/issues/141  but I really dont understand what do I have to do with  FONT_SUBSETTING,
so I came here.

Thanks.

First, you must be using dompdf 0.6.0 beta 3 or later. That version includes both the Deja Vu fonts (which I believe support the characters you need) and include a new font parser (php-font-lib) that allows us to parse fonts on-the-fly (e.g. css @font rules) and to subset any embedded fonts. I recommend you review the requirements outlined in the Unicode How-To. The how-to needs to be updated to reflect changes in beta 3, but the information is still relevant. Then, to enable subsetting, make sure DOMPDF_ENABLE_FONTSUBSETTING is set to true in your config file.

100kb isn't terribly large even with a subsetted font, depending on how many characters are used. You can check to see if subsetting is actually happening by rendering with DOMPDF_ENABLE_FONTSUBSETTING set to both true and false and comparing the file sizes for each render.
Reply all
Reply to author
Forward
0 new messages