ImageMagick is converting only the first page of the pdf

后端 未结 4 1107
Happy的楠姐
Happy的楠姐 2020-12-24 13:13

I am having some trouble with ImageMagick.

I have installed GhostScript v9.00 and ImageMagick-6.6.7-1-Q16 on Windows 7 - 32Bit

When I run the following comma

相关标签:
4条回答
  • 2020-12-24 13:37

    According to the site admin at the ImageMagick forum:

    ImageMagick uses the pngalpha device when it finds an Adobe Illustrator PDF. Many of these are a single page. Ideally, Ghostscript would support a device that allows multiple PDF pages with transparency but it doesn't...

    Easy fix. Edit delegates.xml and change pngalpha to pnmraw.

    This worked for me. I don't know if it introduces any other problems however.

    See this post from their forums.

    0 讨论(0)
  • 2020-12-24 13:37

    I found this solution which convert all pages in the pdf to a single jpg image:

    montage input.pdf -mode Concatenate -tile 1x output.jpg
    

    montage is included in ImageMagick.

    Tested on ImageMagick 6.7.7-10 on Ubuntu 13.04.

    0 讨论(0)
  • 2020-12-24 13:43

    By the way if you need to convert first and second pages then provide in array comma separated values

    convert D:\test\sample.pdf[0,1] D:\test\pages\page.jpg
    

    Resulting JPEG files will be named:

    • for page 1: page-0.jpg
    • for page 2: page-1.jpg

    You can also do

    convert D:\test\sample.pdf[10,15,20-22,50] D:\test\pages\page.jpg
    

    Resulting JPEG files will be named:

    • for page 11: page-10.jpg
    • for page 16: page-15.jpg
    • for page 21: page-20.jpg
    • for page 22: page-21.jpg
    • for page 23: page-22.jpg
    • for page 51: page-50.jpg

    May be it will help to someone.

    0 讨论(0)
  • 2020-12-24 13:51

    You can specify which page to convert by putting a number in [] after the filename:

    convert D:\test\sample.pdf[7] D:\test\pages\page-7.jpg
    

    It should have, however, converted all pages to individual images with your command.

    0 讨论(0)
提交回复
热议问题