Page 1 of 1

conversion problem of PDF to PNG with alpha channel

Posted: 2014-11-17T06:27:22-07:00
by masaharu96
Hello,

I have a problem in which IM or GhostScript can't convert PDF file with alpha channel transparency to PNG format.
The PDF file was made with Adobe Illustrator's drop shadow. The conversion result PNG file does not have transparent background, but has white box background. It seems that IM or GS are not aware the PDF file has alpha channel tranparency.

I tried to find solution on the Web but I have not find any.

Does anyone know how to solve this problem or any hints for this ?

Thanks,

Re: conversion problem of PDF to PNG with alpha channel

Posted: 2014-11-17T10:46:29-07:00
by snibgo
What versions of IM and Ghostscript? If they are old, an upgrade might cure it.

Do you want to convert each PDF page into a raster image, or do you want to extract raster images from the PDF? IM (using Ghostscript) is a good tool for the first, but pdfimages is a good tool for the second.

Re: conversion problem of PDF to PNG with alpha channel

Posted: 2014-11-18T05:13:29-07:00
by masaharu96
I'm using IM ImageMagick-6.7.7-Q16 & gs9.07. What I want to do is to convert one PDF page into one PNG file.
I'm using Windows OS . Tools on Mac or Linux won't help me.

I have found similar discussions on PDF alpha channel problme in this site,
but it seems that any of them didn't show good solutions to me.

I'm still waiting for the information on this.

Thanks,

Re: conversion problem of PDF to PNG with alpha channel

Posted: 2014-11-18T05:43:44-07:00
by pipitas
masaharu96 wrote: I have a problem in which IM or GhostScript can't convert PDF file with alpha channel transparency to PNG format.
The PDF file was made with Adobe Illustrator's drop shadow. The conversion result PNG file does not have transparent background, but has white box background. It seems that IM or GS are not aware the PDF file has alpha channel tranparency.
What is the output of

Code: Select all

identify.exe -version
?

Which version of Ghostscript is installed on your system? Is it 32-bit or 64-bit? Post the output of

Code: Select all

gswin32c.exe --version
gswin64c.exe --version
and of

Code: Select all

gswin32c.exe -h | findstr png
gswin64c.exe -h | findstr png
ImageMagick does not process PDF files itself. It calls Ghostscript as its 'delegate'. Usually then, Ghostscript is called with an `-sDEVICE=pngalpha` option. And that device DOES support the alpha channel! (And if the PDF->PNG conversion with `convert` does work at all, then your Windows system does also have Ghostscript installed, even if you are not aware of it...)

So my commands above are designed to find out if your system has a modern Ghostscript with a `pngalpha` output option.

You can observe the exact Ghostscript command line invoked by ImageMagick by adding `convert -verbose` to your original `convert` command...

The only other possibility I can currently think of: your PDF does not truely have a transparent background, but an opaque white one.

Can you provide a link to your PDF?