1

I'm trying to convert PDFs to an image, but have noticed that when the PDF has embedded fonts, the conversion to image will result in missing content (the content being the one from embedded fonts).

When I say embedded fonts, I mean that the text is actually selectable in the PDF. This means the PDF is not just a rasterized image (e.g. a scanned document). I'm not sure if "embedded font" is the proper term.

In any case, how do I "flatten" or "rasterize" a PDF document before or during conversion to image?

My current command looks like this:

gs \
 -dSAFER \
 -dBATCH \
 -dNOPAUSE \
 -dQUIET \
 -dFirstPage=1 \
 -dLastPage=1 \
 -r288 \
 -sDEVICE=tiffgray \
 -sOutputFile=output.tif \
  input.pdf

1 Answer 1

1

The fact that the text is selectable does not mean that the font it uses is actually embedded. However even if it isn't the text should not be missing.

You haven't said which version of Ghostscript you are using, nor which platform (though I infer Linux from the command).

I'd suggest you try the current version of GS (9.02) and if you still see a problem then report a bug at http://bugs.ghostscript.com. You will need to attach a specimen file, preferably as small as possible, and a command line to reproduce the problem.

I'd also suggest removing the -dQUIET, its possible that GS is trying to tel you something but the message is being suppressed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.