User Tools

Site Tools


PDF output from KiCad in Linux

Using SVG

The most reliable way I've found to get good PDFs from KiCad under Linux is to first plot to SVG and then use an external tool to convert the SVGs to PDF. Plotting to SVG in KiCad isn't difficult:

  • In Eeschema: File > Plot > Plot SVG
  • In Pcbnew: File > Print SVG

However, converting these files to PDF isn't quite as straight-forward. I wrote the script svg2pdf-d to automate the conversion process. Just drop a copy of the script into a KiCad project directory and then run it whenever you want to convert files.

Running this script will delete all *.svg files in the working directory!

This is by design. I want to minimize the number of files that might be out of sync with the source, and keeping both SVGs and PDFs is just asking for trouble!

Put any SVG artwork you need to keep in a subdirectory or edit the script so it doesn't delete *.svg files.

There are a few things more you should note:

  • The script relies on Inkscape, which it runs in batch/shell mode. Inkscape isn't really that light, but it’s arguably something that should be in your FOSS toolkit anyway.
  • The script relies on Zentiy. If this offends your KDE or other sensibilities, I have a version that uses gxmessage or xmessage as well as a pure command-line version. I won't promise to keep these updated though.

Using PostScript

Another alternative is to use PostScript as an intermediate format. Here is a (much shorter) script that uses Ghostscript's ps2pdf for conversion. I prefer the SVG approach above because:

  • The color mapping from SVGs (at least from Eeschema) is truer.
  • Pcbnew gives you much more control over what you can plot to SVG compared to PostScript. In particular, you can't plot composite layers to PostScript.
  • Correct page-sizing with SVG conversion is automatic (I think).

I include the PostScript version here because there might be some limitations with SVGs that I've yet to discover.

kicad/pdf_output_from_kicad_in_linux.txt · Last modified: 2016/02/06 18:21 by mithat