61

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?

3
  • Hopefully, @DA01 will chip in here. He's deeply familiar with Inkscape. Commented Feb 9, 2012 at 21:45
  • I wouldn't say deeply...but I am a fan of it. I don't know the answer but my guess would be that SVG and PDF are simply different file formats and support different parts of each specification. There's a lot you can do with SVG in terms of transparency, blur, blending and the like and I'm assuming PDF simply isn't supporting that yet. You may have to run the SVG through Adobe Illustrator first in hopes that AI will convert it to a format the PDF will be happy with.
    – DA01
    Commented Feb 9, 2012 at 23:41
  • Inkscape has gone through a few updates since this question was asked. I'd be curious to know where this situation stands now, and if there are specific parts of the SVG to PDF conversion that are still problematic. Commented Sep 2, 2015 at 13:43

22 Answers 22

34

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

3
  • 1
    This worked nicely. FYI, the Mac OS command-line tool is located at: /Applications/Inkscape.app/Contents/Resources/bin/inkscape - insert your --file=/My/File.svg etc. after that.
    – Demis
    Commented Nov 21, 2016 at 23:02
  • I tested it with a custom base64 font, but Inkscape (0.92) apparently does not support it.
    – xamid
    Commented Dec 3, 2018 at 21:30
  • @xamid if you're on Windows 10, it could be this: reddit.com/r/Inkscape/comments/bg0rkm/… Commented Dec 8, 2019 at 15:17
17

Actually this has been asked and answered here for linux users.

You need to install librsvg2-bin. I'll just add that you will need to fit page to your svg otherwise it will be truncated. Within Inkscape: File -> Document properties -> Select your svg objects -> fit page to selection.

Then just run:

rsvg-convert -f pdf in.svg > out.pdf
2
  • This tool does not even keep the correct font size, let alone the correct font face.
    – xamid
    Commented Dec 3, 2018 at 21:28
  • Works perfect for me. I had problems with print to pdf (which did not embed fonts) en save as pdf (which did not embed pictures). This solution worked for me.
    – Wilbert
    Commented Jan 5 at 18:06
8

From the main menu, choose:

File → Print... → Print to File

Here you can choose to save the file as PDF, PostScript or SVG.

5

Are you trying to export to .PDF to keep the editing capabilities? Otherwise, if you're trying to share an image with someone from Inkscape, save it as a .JPG or .PNG (if a translucent background is needed).

4
  • 1
    In the past, trying to save as a PNG/jpeg reduced the physical size and resolution of the image remarkably. Perhaps I'm just doing it wrong?
    – Zelbinian
    Commented Feb 9, 2012 at 20:47
  • Do you have the latest version of Inkscape downloaded?
    – kamalo
    Commented Feb 9, 2012 at 21:30
  • @Zelbinian, an SVG has no inherent size or resolution. It is only when you want to export as a PNG that Inkscape would ask for a size. Specify this to be as large as you want. Commented Mar 18, 2012 at 9:46
  • 7
    Changing a vector image to a raster image will definitely not maintain (other aspects of) the integrity of the image.
    – Sparhawk
    Commented Feb 24, 2014 at 5:38
3

On a Linux operating system, I export to PNG then use the convert tool to convert it to PDF.

2
  • 2
    +1 This isn't a bad answer...and is, in fact, a method I've used to get around Inkscape's flaws in masking shapes (that 'explode' when converted directly to PDF). For complex SVGs that Inkscape can't fully turn into a PDF, rasterizing is a viable workaround sometimes.
    – DA01
    Commented Jul 14, 2013 at 16:26
  • This will totally lose any resemblance of quality and vector-ness you have and is thus unsuitable.
    – mirabilos
    Commented Jun 27, 2021 at 16:36
3

I love using Inkscape to draw - it is much more intuitive than Illustrator and produces very professional results.

I used Inkscape to prepare figures for publication, however, and had significant difficulty exporting the figures with publication quality settings. Saving files as .eps did not properly embed my fonts and .pdf did not allow me to save with press quality. (I am using Windows XP and Inkscape Version 0.48.4.)

To get around this, I followed the directions for producing press quality figures found at this link.

These step by step instructions show you how to print to a PDF with embedded text and press quality settings.

I did have difficulty printing to pdf for some of my larger figures (only random portions of my figure would end up in the pdf, which was very frustrating!). To circumvent this problem I grouped all aspects of my Inkscape figure and shrank down the overall size. For some reason this worked really well and I obtained nice looking pdfs for these figures.

Another option is to cut the figure in half (if possible) and print two pdfs. These can be combined in Adobe Acrobat Professional (older versions are available for download at this link.

Click on "Create PDF", Choose "From Multiple Files" and select the pdfs you want to combine. These will show up as individual pages in the pdf document. To combine them to a single page go to File --> Print Under Page Handling change Page Scaling to Multiple pages per sheet.

Then you can customize how many pages you want per sheet. Click OK and your 2 PDFs will now be combined into a single page.

I hope this information is of help to those of you with strict requirements for publication quality figures.

1

It’s been years since I had any problems with transparency of Inkscape-generated PDFs and if I had, those turned out to be a problem of the PDF viewer (or in one case: of an esoteric printer), not of Inkscape. Thus I would say that using a new version of Inkscape should fix such issues.

That being said, since Inkscape 0.47 (from 2009), there is the option Rasterise Filter Effects for PDF export, which should rasterise all those filters (for example blur) that are not supported by the PDF format and keep everything else vectorised.

1

I am using Inkscape and routinely store SVGs into PDF. Stay away from filters, and opaque settings as PDFs (or should I say InkScapes export to PDF) does not handle this feature very well.

I instead use color scales instead of opaque levels to soften colors directly on the palette and avoid the filters altogether. I know this is cumbersome and limits your abilities of what you can do. But exports looks fine if I follow these rules.

1

As of Inkscape 1.0beta2, some of the command line arguments have changed. As such, usage for the 1.0 beta version is:

inkscape {svgPath} --export-area-drawing --without-gui --export-file={destPath}

where I've used the brackets here to indicate the parts you'll want to change for your use. For example, if I had the SVG file pizza.svg and I want to convert it to the PDF pizza.pdf, I would use the following:

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

I could not find these changes in the docs so I'm guessing (as the time I'm writing this) that the docs have yet to catch up.

FWIW: It appears this new approach is meant to simplify the command line a bit. Rather than explicitly specifying the file type to be read and exported, Inkscape uses the file's suffix to implicitly specify the file types.

Another FWIW: If you're using a Mac, there's a good chance inkscape is not in your path - so you can't run inkscape from the command line without some extra work. The simplest approach around this obstacle is to replace inkscape in the above command line examples with /Applications/Inkscape.app/Contents/MacOS/inkscape.

0
  1. Print
  2. Select Bitmap in the Rendering tab and choose the desired resolution.
  3. Select your PDF printer in the General tab.
  4. Print.

rendering tab

bitmap dpi and print

0

If you have FoxIt Reader installed, then you can just

  1. File -> Print (Ctrl+P)
  2. Choose "FoxIt Reader PDF Printer" to export file as a PDF.
0

If you have already set the page size on document properties (make sure your elements fit into the page) > go to print preview. Here you can save it as a pdf and also print it in the desired size without a loss of resolution.

0

I had this problem too, and none of the existing answers worked for me. I found my solution here: https://bugs.launchpad.net/inkscape/+bug/1004887

Add a filter to each image, and then save as pdf. Be sure to check "rasterize filter effects". I was dealing with greyscale images, so I applied a greyscale filter so that the images weren't visibly altered.

0

i had a incskape 0.92.4 trouble with save as pdf "*.pdf file could not be saved" just leave field "limit export with ID" empty (facepalm) enter link description here

1
  • 1
    Your image link is broken and your answer is not very clear... besides this is a very old question, are you sure you're adding useful information? Check How to Answer and then edit your answer to add more details / fix the broken image link.
    – Luciano
    Commented Nov 4, 2019 at 10:43
0

1- Choose Print (from File)

2- Click on the Rendering Tab: Select (change to) Vector.

4- Click on the General Tab, at the top in "Select Printer": choose the printer to PDF, for example on Windows, I have Foxit PDF Printer (because I have Foxit Reader on my machine).

5- Print.

0

A heartily recommendation: cairosvg, a python svg converter.

cairosvg mySVGinputFile.svg -o outputfile.pdf

Advantages:

  • .pdf files have a smaller size as compared to inkscape conversion
  • simpler command line.

If you want to perform batch conversions, i.e., to convert many files at once, see this answer.

3
  • FWIW, I tried this and..: 1) note this is installed via python pip, so pip install cairosvg 2) I ended up with a larger file size and line paths were still rasterized rather than preserved. I don't see an option within cairosvg to preserve as vectors.
    – Vivek Gani
    Commented Feb 11, 2023 at 18:50
  • @VivekGani Did you try with different files or just one? I am quite satisfied with it. Maybe you found a .svg file that cairosvg cannot properly cope with. ´:) Commented Feb 13, 2023 at 16:58
  • Just one that involved a large google earth pro export. I was probably wrong about the rasterization issue, that may have just been due to not waiting for the pdf viewer to refresh when zooming. But it did have a larger file size. So far I've been relying on other tools like 'PDF Tricks' to do image compression.
    – Vivek Gani
    Commented Feb 14, 2023 at 19:22
-1

Try using the Snipping tool that comes with Windows 7. If it's not already pinned to your task bar you will find it under,All Programs,Accessories. Looks like a pair of scissors. That will save it as a jpeg, then open the jpeg and print with the cute PDF.

1
  • This probably isn't the solution Zelbinian is looking for; exporting to PDF would imply that vector objects are maintained. As the other answer pointed out, you could just export the file as a JPG anyway, taking a screenshot would be an inferior method in this case
    – JohnB
    Commented Jan 28, 2013 at 20:02
-1

It is very simple. Save your file/selection as pdf.

2
  • 1
    Which version? Has it changed? See answer of user 14047 and the comment of DA01 ...
    – Mensch
    Commented Oct 1, 2015 at 12:32
  • This answer doesn't address the question. The user's problem isn't that they don't know how to export a PDF from Inkscape, it's that the results are not satisfactory. Commented Oct 1, 2015 at 13:42
-1

I saved my document (including gradient layer over image and image with transparency) as JessyInk zipped PDF. Set the DPI and Save. In the Zip file you will find the PDF file as supposed to.

-1

If you are converting it for sharing purposes then export it as png. In the files tab there is a seperate option for exporting in as png. It will save you from a lot of trouble.

1
  • 3
    Can you elaborate what kind of trouble it will save and why?
    – Welz
    Commented Jan 9, 2019 at 1:13
-1

I have been annoyed by this issue for a long time. As of 2019, the best approach I could find is to put an intermediate postscript step. Using the Make syntax:

rsvg-convert -f ps $^ | gs -sDEVICE=pdfwrite -sOutputFile=$@ -f -

where $^ is the source file and $@ is the target file.

It outputs PDF 1.7 by default with ghostscript 9.27. It solves all the issues I find with the inkscape (version 1.0 alpha) pdf saving engine.

-2

Use GIMP, my friend!

Open the SVG file on it and Export as PDF.

1
  • That's a pretty old question with a bunch of options for working with inkscape itself... GIMP is not a vector editor AFAIK, will it really export the SVG as a vector PDF?
    – Luciano
    Commented Mar 9, 2020 at 10:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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