How to export an Inkscape SVG file to a PDF and maintain the integrity of the image?

Having trouble getting Inkscape to export PDFs cleanly and there don’t seem to be many helpful resources out there. In particular, transparencies are difficult – sometimes the transparency will disappear and sometimes it’ll be made into a solid block.

I’ve fiddled with the save-as-PDF settings in Inkscape and I’ve printed to a PDF using CutePDF without success. Is there some method of exporting or creating a file so that I can get predictable results?

Answer

Inkscape (v1.0) supports command-line options, and that is how I prefer to do it:

inkscape mySVGinputFile.svg --export-area-drawing --batch-process --export-type=pdf --export-filename=output.pdf

Prior to v1.0, the command-line options were different. As of Inkscape (v0.91), this was the equivalent:

inkscape --file=mySVGinputFile.svg --export-area-drawing --without-gui --export-pdf=output.pdf

This is actually the command that LyX uses to prepare SVG images for use in LaTeX. I have used PlantUML to generate SVG, which then goes into PDF.

Here’s a screenshot of the SVG in inkscape, which has pure vectorial representation (including fonts).

SVG in inkscape

Here’s a screenshot of the PDF zoomed in, with a selection of the text “oo” from the word loop, showing that it’s still text in the PDF:

PDF in Acrobat

Attribution
Source : Link , Question Author : Zelbinian , Answer Author : jameshfisher

Leave a Comment