PDF conversion problems ...

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
lsces
Posts: 3
Joined: 2019-07-14T01:40:27-07:00
Authentication code: 1152

PDF conversion problems ...

Post by lsces »

Occasionally in the past I've had thumbnails for pdf files for which the background has turned to black. I resorted to manually generating the thumbnails until the " -background White -layers flatten" fix sorted this but a recent file has given me ALL the pages flattened into the one image. Obviously all I'm trying to get is the first page with a white background as a thumbnail when uploading a pdf. I can bodge things and upload a single page pdf before manually copying over the full document, but there must be an easier way ... or is there some way to tidy the pdf itself instead?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PDF conversion problems ...

Post by snibgo »

To get just the first page, append "[0]" to the pdf name, eg:

Code: Select all

magick in.pdf[0] out.jpg
snibgo's IM pages: im.snibgo.com
lsces
Posts: 3
Joined: 2019-07-14T01:40:27-07:00
Authentication code: 1152

Re: PDF conversion problems ...

Post by lsces »

I've worked out how to add that to the source file string but it's not making any difference. the library code is using convert '$source' '$thumb' and I've added the ; -background White -layers flatten ' between the file strings, and I have [0] inside the '' wrapper for the source file ? This is the problem trying to fix other peoples code :( But can you point me to a manual page which shows the [0] option?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PDF conversion problems ...

Post by snibgo »

snibgo's IM pages: im.snibgo.com
lsces
Posts: 3
Joined: 2019-07-14T01:40:27-07:00
Authentication code: 1152

Re: PDF conversion problems ...

Post by lsces »

Turns out the problem is with the version of ghostscript running on suse Leap 15.0 ... 9.26a is supposed to fix the page select fault but I had to update to the 9.27 to avoid it and now things are working. Need to update 2 more servers as well now :(
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PDF conversion problems ...

Post by fmw42 »

GS 9.27 is also reported to have some issue. I would suggest downgrading to 9.23, 9.24, or 9.25
Post Reply