Discussion:
[Inkscape-user] Convert SVG->PDF with transparency
Tristan Miller
2006-03-15 12:02:23 UTC
Permalink
Greetings.

I just created a poster using Inkscape and want to make a PDF version to
distribute. I use a lot of transparency in the poster, but unfortunately
Inkscape's export filters for Postscript and PDF don't preserve the
transparency.

Can someone suggest another SVG to PDF converter which will preserve
transparency? I tried Cairo's svg2pdf, but it just segfaults midway
through processing the file.

BTW, I'm running GNU/Linux. I do have access to a Windows XP machine, but
not to hundreds of dollars to buy expensive Adobe software.

Regards,
Tristan
--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <> In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
Eric Jonas
2006-03-15 12:35:30 UTC
Permalink
Post by Tristan Miller
Can someone suggest another SVG to PDF converter which will preserve
transparency? I tried Cairo's svg2pdf, but it just segfaults midway
through processing the file.
Transparency is a feature of PDF1.4 which isn't all that
well-supported. It's unfortunate, because with transparency you can do
many simple beautiful effects in SVG.

I have had a degree of success with batik, from the Apache project. It
is mostly billed as a "SVC rasterizer" but it can also "transcode" SVG
to PDF. Sometimes it eats my fonts, sometimes it eats my arrow-heads,
but 98% of the time it does exactly what I want.

http://xmlgraphics.apache.org/batik/

The software itself is Free, but it depends on non-free components of
the sun JVM, and doesn't currently work with gcj. Hopefully that will
change soon.

...Eric
Tristan Miller
2006-03-15 14:38:04 UTC
Permalink
Greetings.
Post by Eric Jonas
Post by Tristan Miller
Can someone suggest another SVG to PDF converter which will preserve
transparency? I tried Cairo's svg2pdf, but it just segfaults midway
through processing the file.
I have had a degree of success with batik, from the Apache project. It
is mostly billed as a "SVC rasterizer" but it can also "transcode" SVG
to PDF. Sometimes it eats my fonts, sometimes it eats my arrow-heads,
but 98% of the time it does exactly what I want.
Alas, batik too fails miserably:

[***@linux:/tmp/batik-1.6]$ java -jar batik-rasterizer.jar -m
application/pdf Psychedelic\ poster.svg
About to transcode 1 SVG file(s)

Converting Psychedelic poster.svg to Psychedelic poster.pdf ...
org.apache.batik.transcoder.TranscoderException: null
Enclosed Exception:
The current document is unable to create an element of the requested type
(namespace: http://www.w3.org/2000/svg, name: flowRoot).
at
org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown
Source)
at
org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown
Source)
at org.apache.batik.apps.rasterizer.SVGConverter.transcode(Unknown
Source)
at org.apache.batik.apps.rasterizer.SVGConverter.execute(Unknown
Source)
at org.apache.batik.apps.rasterizer.Main.execute(Unknown Source)
at org.apache.batik.apps.rasterizer.Main.main(Unknown Source)
... error (SVGConverter.error.while.rasterizing.file)

Regards,
Tristan
--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <> In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
Tavmjong Bah
2006-03-15 15:46:26 UTC
Permalink
Post by Tristan Miller
Converting Psychedelic poster.svg to Psychedelic poster.pdf ...
org.apache.batik.transcoder.TranscoderException: null
The current document is unable to create an element of the requested type
(namespace: http://www.w3.org/2000/svg, name: flowRoot).
flowRoot (i.e. Flowed Text) is an SVG 1.2 proposed object type. Batik is
an SVG 1.1 renderer.

Change the flowRoot objects to regular text (Text->Convert to Text) and
try Batik again.


Tav
Tristan Miller
2006-03-15 23:56:13 UTC
Permalink
Greetings.
Post by Tavmjong Bah
Post by Tristan Miller
Converting Psychedelic poster.svg to Psychedelic poster.pdf ...
org.apache.batik.transcoder.TranscoderException: null
The current document is unable to create an element of the requested
type (namespace: http://www.w3.org/2000/svg, name: flowRoot).
flowRoot (i.e. Flowed Text) is an SVG 1.2 proposed object type. Batik is
an SVG 1.1 renderer.
Change the flowRoot objects to regular text (Text->Convert to Text) and
try Batik again.
Doing so let Batik run without producing any errors, but the PDF it
produced isn't quite right. Adobe Reader refuses to open it, saying "An
unrecognized token '-3.662109375E-4' was found.". Kpdf opens it, and
while there is indeed transparency in the right parts of the image, in
other parts there is transparency where there shouldn't be any!

Regards,
Tristan
--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <> In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
Alberto Simões
2006-03-16 10:55:20 UTC
Permalink
Inkscape conversion from SVG to PDF is using PS. PS as I know it
doesn't support transparency, and thats the main problem.

When I need to export an SVG to PDF with transparencies I need to
flatten the colors. I can't remember well how I do that, but basically
use the pick color tool to check the real visible color, and change
the object color/transparency accordingly.

I hope this helps.
Hugs
Alberto
Post by Tristan Miller
Greetings.
Post by Tavmjong Bah
Post by Tristan Miller
Converting Psychedelic poster.svg to Psychedelic poster.pdf ...
org.apache.batik.transcoder.TranscoderException: null
The current document is unable to create an element of the requested
type (namespace: http://www.w3.org/2000/svg, name: flowRoot).
flowRoot (i.e. Flowed Text) is an SVG 1.2 proposed object type. Batik is
an SVG 1.1 renderer.
Change the flowRoot objects to regular text (Text->Convert to Text) and
try Batik again.
Doing so let Batik run without producing any errors, but the PDF it
produced isn't quite right. Adobe Reader refuses to open it, saying "An
unrecognized token '-3.662109375E-4' was found.". Kpdf opens it, and
while there is indeed transparency in the right parts of the image, in
other parts there is transparency where there shouldn't be any!
Regards,
Tristan
--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <> In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Inkscape-user mailing list
https://lists.sourceforge.net/lists/listinfo/inkscape-user
--
Alberto Simões
Aaron Spike
2006-03-15 14:29:49 UTC
Permalink
Post by Tristan Miller
Can someone suggest another SVG to PDF converter which will preserve
transparency? I tried Cairo's svg2pdf, but it just segfaults midway
through processing the file.
Cairo's svg2pdf was just a demo and is probably abandoned. Check out the
rsvg-convert utility from librsvg. I don't know if the utility is
included in the usual distribution packages, so you may have to grab CVS
and build from source. rsvg-convert does currently rasterize the SVG
into PDF but it is still something to look at.

Aaron Spike
Ted Gould
2006-03-18 18:57:23 UTC
Permalink
Post by Tristan Miller
Can someone suggest another SVG to PDF converter which will preserve
transparency? I tried Cairo's svg2pdf, but it just segfaults midway
through processing the file.
Two things I didn't see people mention:

- Scribus has good SVG import and good PDF export.

- I've used PDF creator on Windows before, and I thought that I got
transparency there. I don't remember for sure (it was a long time ago)
but you might try that.

--Ted

Loading...