Reputation: 103
In my project i use GhostScript to convert pdf file to png image. The problem is that it cannot process the font that not emmbeded in pdf file correctly, thus output was wrong. When using pdftoppm (an xpdf tool) the problem was fixed. So i want to know what is the diffence between ghostscript and xpdf in converting phase? Why does GhostScript need to use font but Xpdf doesnt?
Upvotes: 0
Views: 427
Reputation: 31199
Without seeing the PDF file it's impossible to tell for certain but there are three possibilities I can think of:
The PDF file does contain the font and for some reason Ghostscript can't find or use it. That would be a bug, probably fixed by using the current version. If that doesn't fix it then you should submit a bug report.
You have the font available on your Operating System and xpdf has been told where to find it. If this is the case you can almost certainly give Ghostscript the same information via either FontConfig (on Linux) or by editing one of fontmap.GS or cidfmap, depending on the nature of the font.
xpdf isn't using the correct font either, but it just so happens that, by good fortune, the font it uses as a substitute is closer to the original font than the font Ghostscript uses as a substitute. As with 2 above you can change what Ghostscript is using.
This is, of course, why all PDF files should embed the fonts they use (as subsets at least), especially all the CIDFonts they use.
Upvotes: 2