Convert PDF to image with high resolution

前端 未结 18 2030
故里飘歌
故里飘歌 2020-11-28 00:13

I\'m trying to use the command line program convert to take a PDF into an image (JPEG or PNG). Here is one of the PDFs that I\'m trying to convert.

I want the progr

18条回答
  •  孤独总比滥情好
    2020-11-28 00:38

    Linux user here: I tried the convert command-line utility (for PDF to PNG) and I was not happy with the results. I found this to be easier, with a better result:

    • extract the pdf page(s) with pdftk
      • e.g.: pdftk file.pdf cat 3 output page3.pdf
    • open (import) that pdf with GIMP
      • important: change the import Resolution from 100 to 300 or 600 pixel/in
    • in GIMP export as PNG (change file extension to .png)

    Edit:

    Added picture, as requested in the Comments. Convert command used:

    convert -density 300 -trim struct2vec.pdf -quality 100 struct2vec.png

    GIMP : imported at 300 dpi (px/in); exported as PNG compression level 3.

    I have not used GIMP on the command line (re: my comment, below).

提交回复
热议问题