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

308 views
Skip to first unread message

Chris McClelland

unread,
May 18, 2012, 9:11:13 AM5/18/12
to
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://
www.swaton.ukfsn.org/comp.text.pdf/

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://
www.swaton.ukfsn.org/comp.text.pdf/in.pdf) - perhaps some problem that
viewers are lenient with but Ghostscript is strict with?

Chris

$ wget -q http://www.swaton.ukfsn.org/comp.text.pdf/gradient.svg
$ 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
8.71
$ uname -a
Linux wotan 2.6.32-5-amd64 #1 SMP Sun May 6 04:00:17 UTC 2012 x86_64 GNU/
Linux
$ cat /etc/issue
Debian GNU/Linux 6.0 \n \l

Chris McClelland

unread,
May 18, 2012, 9:49:56 AM5/18/12
to
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
Forward
0 new messages