Skip to content

snhobbs/board2pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Board2Pdf

Board2Pdf is a KiCad Action Plugin to create good looking pdf files from the board. The outputted pdf is vector based and searchable.

Two examples of what the plugin can output can be found here:
armory-Assembly.pdf ( 1 982 kB) Project is found here
hackrf-one-Assembly.pdf ( 1 579 kB) Project is found here

When loaded the plugin looks like this. Here the user can configure how the pdf shall look. Screenshot

This plugin ONLY works with the KiCad 6.0 and later. It does NOT work with KiCad 5.1.x or earlier versions. Take the leap! You won't regret it.

https://gitlab.com/dennevi/Board2Pdf/

Installation

The easiest way to install is to open KiCad -> Plugin And Content Manager. Select Board2Pdf in the Plugins tab, press Install and then Apply Changes.

If you only want to use the CLI (use Board2Pdf from the command line) you can also install Board2Pdf using pip: pip install board2pdf. Then you can use the Board2Pdf CLI by calling board2pdf just like any other application installed from pip.

For instructions on manual installation, see Wiki - Installation

Also, see Dependencies below.

Dependencies

For basic functionality Board2Pdf uses pypdf which is included when installing Board2Pdf. You don’t need to install any dependencies if this functionality is enough for you.

If you install PyMuPDF you can create the pdf files about ten times faster.

More information in Wiki - Install dependencies.

Problem with Ubuntu and possibly other Linux distros

When PyMuPDF (fitz) is installed with pip, KiCad crashes with a segmentation fault when Board2Pdf is loaded. Board2Pdf loads when the PCB Editor loads, so the crash happens directly when the PCB Editor is started. If this happens to you, you have two options:

  1. Uninstall PyMuPDF using python -m pip uninstall --upgrade PyMuPDF or pip uninstall --upgrade PyMuPDF and use pypdf instead.
  2. Uninstall PyMuPDF as in (1), but install it again using the apt package manager: sudo apt install python3-fitz

Usage - GUI

The plugin includes a default configuration which should make it more or less self explanatory if you test it out. The basic idea is that each template will result in a page in the pdf file that's created by this plugin. You can enable any number of templates to get different views and color modes of the pcb. Each template can be individually configured to give the desired output. It's completely up to you which layers to show, and which colors the layers shall have.

More information can be found in the Wiki - Usage GUI.

Usage - CLI

Board2Pdf can be executed from the command line using board2pdf-cli.py.

More information can be found in the Wiki - Usage CLI.

Support

First search the KiCad forum to see if someone else has asked the same thing. If not, post your question in the forum and tag me by writing @albin. That way I will see your post and answer as soon as I can.

Contributing

If you find a bug, please add an issue in the GitLab project.

If you make some improvements, please issue a pull request. All help is appreciated!

Authors and acknowledgment

This script is written by Albin Dennevi, with contributions from others. If you need to come in contact with me please use the KiCad forum as described under Support. But for bugs and feature requests, please add an issue in GitLab.

Credit goes to qu1ck, the author of the InteractiveHtmlBom plugin. I used the GUI of this project as a starting point when making the GUI for this project.

License

This plugin is licensed under the open-source GNU GPL license, version 3.0 or later. A copy of the license is included in this software, and it can also be viewed here. This is the same license as pdfCropMargins is licensed under, personally I would've choosen a more open license.

Project status

This project is considered to be finished. When serious bugs are reported I will try my best to fix them, but don't expect to much progress in adding features from my side.