Convert SVG->PDF with transparency
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
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
From MAILER-DAEMON Wed Mar 15 05:45:27 2006
Date: Wed, 15 Mar 2006 14:44:59 +0100 From: Mail Delivery Subsystem <MAILER-DAEMON@...1685...> Message-Id: <200603151344.k2FDix1J009954@...1685...> To: inkscape-user@lists.sourceforge.net MIME-Version: 1.0 Content-Type: multipart/report; report-type=delivery-status; boundary="k2FDix1J009954.1142430299/smtp17.clb.oleane.net" Auto-Submitted: auto-generated (failure) X-Spam-Score: 0.0 (/) X-Spam-Report: Spam Filtering performed by sourceforge.net. See http://spamassassin.org/tag/ for more details. Report problems to http://sf.net/tracker/?func=add&group_id=1&atid=200001 Subject: [Inkscape-user] Returned mail: see transcript for details Sender: inkscape-user-admin@lists.sourceforge.net Errors-To: inkscape-user-admin@lists.sourceforge.net X-BeenThere: inkscape-user@lists.sourceforge.net X-Mailman-Version: 2.0.9-sf.net Precedence: bulk Reply-To: inkscape-user@lists.sourceforge.net List-Unsubscribe: https://lists.sourceforge.net/lists/listinfo/inkscape-user, mailto:inkscape-user-request@lists.sourceforge.net?subject=unsubscribe List-Id: Inkscape User Community <inkscape-user.lists.sourceforge.net> List-Post: mailto:inkscape-user@lists.sourceforge.net List-Help: mailto:inkscape-user-request@lists.sourceforge.net?subject=help List-Subscribe: https://lists.sourceforge.net/lists/listinfo/inkscape-user, mailto:inkscape-user-request@lists.sourceforge.net?subject=subscribe List-Archive: http://sourceforge.net/mailarchive/forum.php?forum=inkscape-user
This is a MIME-encapsulated message
--k2FDix1J009954.1142430299/smtp17.clb.oleane.net Content-Type: text/plain
The original message was received at Wed, 15 Mar 2006 14:44:51 +0100 from localhost [127.0.0.1]
----- The following addresses had permanent fatal errors ----- <.00584625@...1684...> (reason: 550 <.00584625@...1684...>: User unknown in local recipient table)
----- Transcript of session follows ----- ... while talking to [83.206.74.81]:
DATA
<<< 550 <.00584625@...1684...>: User unknown in local recipient table 550 5.1.1 <.00584625@...1684...>... User unknown <<< 554 Error: no valid recipients
--k2FDix1J009954.1142430299/smtp17.clb.oleane.net Content-Type: message/delivery-status
Reporting-MTA: dns; smtp17.clb.oleane.net Received-From-MTA: DNS; localhost Arrival-Date: Wed, 15 Mar 2006 14:44:51 +0100
Final-Recipient: RFC822; .00584625@...1684... Action: failed Status: 5.1.1 Remote-MTA: DNS; [83.206.74.81] Diagnostic-Code: SMTP; 550 <.00584625@...1684...>: User unknown in local recipient table Last-Attempt-Date: Wed, 15 Mar 2006 14:44:58 +0100
--k2FDix1J009954.1142430299/smtp17.clb.oleane.net Content-Type: message/rfc822
Return-Path: inkscape-user@lists.sourceforge.net Received: from smtp17.clb.oleane.net (localhost [127.0.0.1]) by smtp17.clb.oleane.net (antivirus) with ESMTP id k2FDip1J009940 for <.00584625@...1684...>; Wed, 15 Mar 2006 14:44:51 +0100 Received: from smtp17.clb.oleane.net (localhost [127.0.0.1]) by smtp17.clb.oleane.net (antispam) with ESMTP id k2FDipuc009929 for <.00584625@...1684...>; Wed, 15 Mar 2006 14:44:51 +0100 Received: from ascom.fr (ALyon-152-1-147-11.w86-211.abo.wanadoo.fr [86.211.26.11]) by smtp17.clb.oleane.net with ESMTP id k2FDikHu009665 for <.00584625@...1684...>; Wed, 15 Mar 2006 14:44:47 +0100 Message-Id: <200603151344.k2FDikHu009665@...1685...> From: inkscape-user@lists.sourceforge.net To: .00584625@...1684... Subject: [SPAM] Private document Date: Wed, 15 Mar 2006 14:47:35 +0100 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0016----=_NextPart_000_0016" X-Priority: 3 X-MSMail-Priority: Normal X-Spam-Flag: YES X-Spam-Level: xxxxxx
This is a multi-part message in MIME format.
------=_NextPart_000_0016----=_NextPart_000_0016 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit
------------------ Virus Warning Message (on smtp17)
Found virus WORM_NETSKY.P in file your_document.pif The uncleanable file is deleted.
---------------------------------------------------------
------=_NextPart_000_0016----=_NextPart_000_0016 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit
I cannot believe that.
+++ Attachment: No Virus found +++ Panda AntiVirus - www.pandasoftware.com
------=_NextPart_000_0016----=_NextPart_000_0016 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit
------------------ Virus Warning Message (on smtp17)
your_document.pif is removed from here because it contains a virus.
--------------------------------------------------------- ------=_NextPart_000_0016----=_NextPart_000_0016--
--k2FDix1J009954.1142430299/smtp17.clb.oleane.net--
Greetings.
In article <20060315123530.GJ15189@...1683...>, Eric Jonas wrote:
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:
[psy@...1686...:/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
On Wed, 2006-03-15 at 14:38 +0000, Tristan Miller wrote:
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).
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
Greetings.
In article <1142437587.3805.21.camel@...151...>, Tavmjong Bah wrote:
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).
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
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
On 3/15/06, Tristan Miller <psychonaut@...1679...> wrote:
Greetings.
In article <1142437587.3805.21.camel@...151...>, Tavmjong Bah wrote:
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).
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&da... _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
-- Alberto Simões
Tristan Miller wrote:
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
On Wed, 2006-03-15 at 12:02 +0000, Tristan Miller wrote:
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
participants (6)
-
Aaron Spike
-
Alberto Simões
-
Eric Jonas
-
Tavmjong Bah
-
Ted Gould
-
Tristan Miller