Page 1 of 1
Convert PDF to JPEG
Posted: 2006-02-21T08:29:54-07:00
by elisegev
I have a PDF file. When I convert it to JPEG, I cannot display the result in any browser (IE and Firefox). Firefox says: The image "..." cannot be displayed, because it contains errors.
This issue happens on Windows and Solaris with ImageMagick 6.2.5. The converted file can be displayed in any JPEG editor and in (im)display. The PDF file is 464Kb and the JPEG is 162 Kb. The PDF file is created with Adobe Illustrator as a layered document, where one of the layers is a JPEG file.
What could the problem be? How can I post the original file for other people to reproduce the problem?
Posted: 2006-02-21T13:36:49-07:00
by magick
Try adding -interlace none to your command line to create a non-progressive JPEG image. Some browsers cannot display progressive JPEG images.
Posted: 2006-02-21T14:23:47-07:00
by elisegev
magick wrote:
Try adding -interlace none to your command line to create a non-progressive JPEG image. Some browsers cannot display progressive JPEG images.
I tried adding '-interlace none' to the command, but got the same results.
The ImageMagick is 6.2.4 and not 6.2.5.
Posted: 2006-02-22T13:39:07-07:00
by elisegev
I don't know much about how JPEG are stored and what standards they follow. It seems that this file, which is generated from a PDF file, has an Alpha channel. I get this information when loading the file with javax.imageio and java.awt.image packages. Are JPEG files allowed to have an alpha channel? Can it be turned off?
When loading the file as java.awt.image.BufferedImage, I get an javax.imageio.IIOException: Unsupported Image Type. But, it can be read as java.awt.image.Raster, which provides the above information.
Re: Convert PDF to JPEG
Posted: 2006-02-22T14:42:17-07:00
by elisegev
tdromba wrote:
Check to be certain the resultant jpeg is rgb, not cmyk. Some browsers will not display cmyk images, including FF. Add -colorspace RGB to the command as a start.
TD
Thanks! This suggestion worked. Now I can display the JPEG file in a browser. The original file was created with Adobe Illustrator and it says 'CMYK' in it.