Convert PDF to image with high resolution

前端 未结 18 1972
故里飘歌
故里飘歌 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条回答
  •  -上瘾入骨i
    2020-11-28 00:49

    normally I extract the embedded image with 'pdfimages' at the native resolution, then use ImageMagick's convert to the needed format:

    $ pdfimages -list fileName.pdf
    $ pdfimages fileName.pdf fileName   # save in .ppm format
    $ convert fileName-000.ppm fileName-000.png
    

    this generate the best and smallest result file.

    Note: For lossy JPG embedded images, you had to use -j:

    $ pdfimages -j fileName.pdf fileName   # save in .jpg format
    

    With recent poppler you can use -all that save lossy as jpg and lossless as png

    On little provided Win platform you had to download a recent (0.37 2015) 'poppler-util' binary from: http://blog.alivate.com.au/poppler-windows/

提交回复
热议问题