开发者

GhostScript or ImageMagick - how to "flatten" a PDF?

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 "开发者_StackOverflow社区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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜