Thumbnail-ing a multi-page PDF w convert only creates 1 file

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
beeg
Posts: 3
Joined: 2012-12-19T13:10:56-07:00
Authentication code: 6789

Thumbnail-ing a multi-page PDF w convert only creates 1 file

Post by beeg »

Just upgraded to 6.8.0.7 and `convert -thumbnail 'x300>' -border 2x2 multipage.pdf outfile.png` only creates outfile.png instead of outfile-1.png, outfile-2.png, ...outfile-x.png like it used to.

I have tested it on a few different versions of FreeBSD with the same results. I have 6.7.x on a few other machines and it functions like I have been used to with the pages spilt into separate files. I haven't been able to get time to install it on any OS other than FreeBSD so far.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Thumbnail-ing a multi-page PDF w convert only creates 1

Post by fmw42 »

try reading the pdf first and then creating the thumbnail and border

convert multipage.pdf -thumbnail 'x300>' -border 2x2 outfile.png

see
http://www.imagemagick.org/Usage/basics/#why

If that fails then post a link to your pdf file


Also if your pdf has multiple pages and transparency, you will not be able to process all the pages and keep the transparency. IM will only process one page with transparency or several pages without transparency. See recent post at viewtopic.php?f=1&t=22463&p=93634#p93634
beeg
Posts: 3
Joined: 2012-12-19T13:10:56-07:00
Authentication code: 6789

Re: Thumbnail-ing a multi-page PDF w convert only creates 1

Post by beeg »

Thanks for the suggestion Fred. Unfortunately it didn't make any difference using the modified command as I still get the exact same (single) output file.

I am fairly certain that the PDF itself is not the issue, since I can process that same PDF with IM 6.5 on a different host and get the results I am used to. This is a matter of it worked yesterday and doesn't today after I installed a newer version of IM. I can't completely blame it on IM yet because ghostscript was possibly updated at the same time as IM, and I don't know how much of the process is handled by gs.

I was able to get the newer version installed on another OS today, and I get the single file there now too, so it isn't likely the FreeBSD port that is causing it.

I can get around it by determining how many pages the PDF has and repeating my command x times with multipage.pdf[x] as my input file and outfile-x.png as my output, but that is fairly time consuming in comparison to the old method.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Thumbnail-ing a multi-page PDF w convert only creates 1

Post by fmw42 »

see viewtopic.php?f=1&t=22463#p93634 If your pdf has transparency, then IM can only handle one page. If your pdf has multiple pages and no transparency, then IM can process that. But each case needs a different sDEVICE edited into the delegates.xml file.

I doubt it is GS, but IM does use that to do the processing. If you upgraded GS, you may also need to upgrade the GS fonts. But my guess is that the problem is that you need to edit your delegates.xml file so that sDEVICE is set to pnmraw rather than pngalpha. Check your delegates.xml file that is installed and also check whether your PDF file has transparency.

Otherwise, post a link to your pdf file so others can examine and test with it.
beeg
Posts: 3
Joined: 2012-12-19T13:10:56-07:00
Authentication code: 6789

Re: Thumbnail-ing a multi-page PDF w convert only creates 1

Post by beeg »

fmw42 wrote:see viewtopic.php?f=1&t=22463#p93634 If your pdf has transparency, then IM can only handle one page. If your pdf has multiple pages and no transparency, then IM can process that. But each case needs a different sDEVICE edited into the delegates.xml file.
:D

That was apparently it. Sorry I disregarded it originally. All my PDFs that I work with come from a copier/scanner and I would have never guessed they come with transparency.
And I could be wrong, but based on the fact that the line needing editing says command='"gs" , I am guessing it is something that changed somewhere along the way in gs rather than IM. On my other host that isn't as up to date, the sDEVICE is still pngalpha, and it splits the pages of the exact same PDF just fine.

Thank you.
Post Reply