Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
How do I convert an SVG to a PDF on Linux

I would like to programatically convert SVG files to PDF files. However, the SVG files contain text that must be searchable in the generated PDF files. Also, it has to work on Red Hat Enterprise Linux 5.3 or CentOS 5.3 for the x86_64 architecture. It would be nice if it were Open Source or at least not very expensive.

Here is what I've tried. All of these, except Batik, work fine on Debian Lenny.

Inkscape
I can get it installed using autopackages from http://inkscape.modevia.com/ap, but when I use it from the command line, the text is not searchable.

Batik rasterizer [sic]
When it converts SVG files to PDF files, the text is no longer searchable.

svg2pdf
The source for this and several of its dependencies are available to download. I have been trying to get it to compile on CentOS, but haven't had success yet. I found a precompiled version for Debian x86_64, but it doesn't work on CentOS.

rsvg-convert
Generated PDF isn't searchable on CentOS 5.3. Perhaps installing a newer version of cairo would help. Thanks to DaveParillo for mentioning rsvg-convert (on superuser).

SOLUTION (but perhaps some of the above will still be useful to the reader)
princeXML
It works fine on CentOS when installed from source. For some reason it doesn't work when installed from the .rpm. Thanks Erik Dahlström! (provided solution that worked for my case on stackoverflow)

Cross posted on stackoverflow

share|improve this question

marked as duplicate by Renan, Dave Rook, Indrek, BBlake, soandos Sep 25 '12 at 13:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Thanks for taking the time to mention what actually worked for you. –  DaveParillo Dec 18 '09 at 23:16
add comment

2 Answers 2

up vote 2 down vote accepted

most tools out there are (like batik or imagemagick) are going to turn your vector data into a raster map.

I would try rsvg-convert. It uses cairo as a backend, so you may have the same compile problems you're having with svg2pdf.

share|improve this answer
    
Thanks! I really appreciate your help. –  Christopher Bottoms Dec 5 '09 at 20:48
    
+1, now that I can. –  Christopher Bottoms Dec 18 '09 at 20:44
add comment

One other (so far very little known) alternative is GhostPDL's gsvg (on Windows: gsvg.exe). GhostPDL is the sister application to Ghostscript (currently being merged into one single repostory at http://svn.ghostscript.com/ghostpdl/). GhostPDL is for SVG, XPS and PCL processing, similar to what Ghostscript is for PostScript and PDF processing. Here goes:

gsvg.exe ^
   -dBATCH ^
   -dNOPAUSE ^
   -dSAFER ^
   -sDEVICE=pdfwrite ^
   -sOutputFile=my.pdf ^
   [...more options you may want/need...] ^
   c:/path/to/my.svg
share|improve this answer
    
Interesting. I'd like to know more. The repository seems to have been relocated to svn.ghostscript.com/ghostscript/trunk/ghostpdl. However, I looked around and did not find gsvg.exe. –  Christopher Bottoms Jul 21 '10 at 13:32
    
@molecules: You need to build the .exe yourself. As you noted, the source location has changed. I've build trunk successfully with MSVC++ Express 2008 using the default .vcproj file that is in the Ghostscript sources. A Ghostscript 9.00 release is pending in the next few weeks -- I don't know if they will ship an binary of GhostPDL with an gsvg.exe then. –  Kurt Pfeifle Aug 9 '10 at 15:21
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.