Some PDF thumbnails are all black!

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
mvigor

Some PDF thumbnails are all black!

Post by mvigor »

This morning I've added a system call to convert into my PHP and it worked beautifully to create thumbnails for the first page of my PDF documents...for MOST of the books.

However, for a certain few books, each chapter's thumbnail is just a black square.

http://www.teachinglearning.com/freebie ... php?type=B

Look at the linked page and scroll down through it. Notice that for most books, every thumbnail was created successfully. Then notice that for other entire books, every thumbnail is just a black rectangle.

Does 'convert' choke on certain fonts or other PDF elements?

The command I am using with mixed success is

convert -quality 50 -border 3x3 -bordercolor #000000 filename.pdf[0] -resize 100x120 filenumber_thumb.jpg
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Some PDF thumbnails are all black!

Post by magick »

ImageMagick uses the Ghostscript delegate program to render PDF. To ensure a successful conversion install the very latest Ghostscript and ImageMagick releases. If you still have problems, post a URL to one or two of your PDF's that fail to convert properly and we will download and see if we can reproduce the problem.
mvigor

Re: Some PDF thumbnails are all black!

Post by mvigor »

I was afraid you were going to say that! I'm at the mercy of my web host to keep your scripts updated and they are quite difficult to get a response from. I'll ask them, but in the mean time I'll post a few links for you.

Please keep in mind that it is strange that my failures are grouped by the fact that they are all from the same book, while my successes are also grouped the same way. My instinct tells me it's font related, but it would take a good bit of testing to know for sure.
Last edited by mvigor on 2008-03-31T08:58:01-07:00, edited 1 time in total.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Some PDF thumbnails are all black!

Post by magick »

This command works from us:
  • convert -quality 50 -border 3x3 -bordercolor #000000 -colorspace rgb filename.pdf'[0]' -thumbnail 100x120 filenumber_thumb.jpg
The colorspace option converts CMYK PDF files to RGB and the thumbnail option is optimized for generating thumbnail images.
mvigor

Re: Some PDF thumbnails are all black!

Post by mvigor »

It works! Thank you! :D :happy dance:
nabritta

Re: Some PDF thumbnails are all black!

Post by nabritta »

How do I change a PDF file to a different program? Okay, So I have a picture in a PDF file that I was trying to upload onto facebook. It didn't let me do so. My question today is, how am I able to put the picture that I have in the PDF file into another program which I can upload these onto Facebook?
______________________
market samurai ~ marketsamurai ~ marketsamurai.com
Post Reply