Forum Bugs

Huge File when Chinese character is present

alecjacobson
If I have a simple hello world file:

<!DOCTYPE HTML>
<html><body>A</body></html>


and I run `prince test.html` the output .pdf will be tiny (10K).

If I change this to

<!DOCTYPE HTML>
<html><body>人</body></html>


then the output will be (6.8MB).

I'm guessing that some enormous font is being included (but have no idea). Is there anyway to shrink this output? Perhaps this can be/has been fixed in a new version of prince.

For now, I'd also appreciate any pdf postprocessing that will fix this massive file size increase.

alecjacobson
Indeed, the problem appears to be that prince is not subsetting the chinese font.

As a postprocess stop gap, the following works:

Save As Other > Optimized PDF ...
Check Fonts
Check Subset all embedded fonts


Or using ghostscript, issue:

gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -sOutputFile=output.pdf -dSubsetFonts=true -f  input.pdf
mikeday
Please try the Prince latest builds, which support subsetting for CFF fonts.
alecjacobson
great! that fixed it.