Gradients lost in SVG -> Inkscape -> PDF -> Ghostscript

Skip to first unread message

Chris McClelland

May 18, 2012, 9:11:13 AM5/18/12
I'm building a PDF using LaTeX, which incorporates embedded PDF images
generated from Inkscape SVGs. The resulting latex-generated PDF document
file is rather large, so I have been running it through Ghostscript to
compress it a bit. This approach has been working nicely right up to the
point where I started using gradients in my images. At that point the
gradients appear to have been stripped by Ghostscript.

I have put together a small example and uploaded the source Inkscape SVG,
the generated Inkscape PDF and the post-Ghostscript PDF to http://

I have recorded exactly what I did to generate the in.pdf and out.pdf
files below.

Does anyone know why Ghostscript is removing the gradients like this? I
suspect it's a problem with the PDF generated by InkScape (http:// - perhaps some problem that
viewers are lenient with but Ghostscript is strict with?


$ wget -q
$ inkscape -A in.pdf gradient.svg
$ gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=out.pdf in.pdf
$ inkscape --version
Inkscape 0.47 r22583 (Mar 12 2010)
$ gs --version
$ uname -a
Linux wotan 2.6.32-5-amd64 #1 SMP Sun May 6 04:00:17 UTC 2012 x86_64 GNU/
$ cat /etc/issue
Debian GNU/Linux 6.0 \n \l

Chris McClelland

May 18, 2012, 9:49:56 AM5/18/12
Never mind, it was a bug in Ghostscript 8.71 (included with Debian 6.0).
Upgrading to Ghostscript 9.01 fixed the problem.
Reply all
Reply to author
0 new messages