0
votes

I'm converting pdf (created with adobe illustrator) into transparent png file, with following command:

gs -q -sDEVICE=pngalpha -r300 -o target.png -f source.pdf

However, there's undesired white boxes in the resulting PNG, looks like it's auto generated by ghostscript, some bounding box. (see attached image)

enter image description here

Tryied both gs-9.05 and gs-9.10, same bad result.

I've tried to export to PNG file from Illustrator or Inkscape manually, the result is good.

enter image description here

What does Inkscape do to render it correct, and How could I eliminate those white boxes using ghostscript?

2

2 Answers

2
votes

Try mudraw of latest (1.3) muPDF, as far as I checked it creates nice PNGs from PDF files with 1.4 transparency:

mudraw -o out.png -c rgba in.pdf

"rgba" being, as you understand, RGB + alpha

0
votes

In the general case, you can't. PDF does support transparency, but the underlying media is always assumed to be white and opaque. So anywhere that marks are made on the medium is no longer transparent, its white.

You don't say which version of Ghostscript you are using, but if its earlier than 9.10 you could try upgrading.