Board2Pdf is a KiCad Action Plugin to create good looking pdf files from the board. The outputted pdf is vector based and searchable.
Version 1.1 now released! This version is now available in the Plugin and Content Manager.
In order to increase the speed (with about 10x) Board2Pdf now requires PyMuPDF as a dependency. It’s recommended to install pdfCropMargins which includes PyMuPDF as well as some other useful pdf tools. You can install it with this command:
python -m pip install --upgrade pdfCropMargins
The command must be run from the KiCad Command Prompt. Not from your default terminal or from the Scripting Console within the PCB Editor.
I don’t know how to open the KiCad 7.0 Command Prompt in ARM MacOS. On Windows there’s a shortcut to it in the Start Menu where the shortcuts to KiCad, PCB Editor, Schematic Editor and such are. I’m guessing there should be a similar collection of shortcuts somewhere on your system?
I have no idea unfortunately. What Linux distribution are you running? Is there a place somewhere where the installer placed shortcuts to KiCad, PCB Editor, Schematic Editor etc.? I was hoping that there would also be a shortcut to KiCad 7.0 Command Prompt in the same place.
On windows the KiCad 7.0 Command Prompt shortcut goes to “C:\Program Files\KiCad\7.0\bin\kicad-cmd.bat”. Maybe there’s a kicad-cmd.sh in your installation folder?
On linux there is no need for kicad command prompt because it uses system utils (unless you use flatpak install in which case it’s complicated). So just run the pip install command from your system terminal. Add --user to the end of it to avoid installing in system dirs and needing root.
On mac I think situation is the same, KiCad switched to using system python. Hopefully mac users can confirm.
Hi @albin, this is probably a KDE related problem (I use KUBUNTU 20.04). Actually pcbnew generates a “segmentation fault” when pugin Board2Pdf v1.1 is installed. While in XFCE (Linux Mint Xfce) this problem does not exist and the plugin works correctly.
In my opinion the problem is not related to the presence or absence of PyMuPDF.
I am using KiCad v7:
@albin unfortunately, I was unable to trace the cause of the malfunction. I can only say that I have 2 PCs with Kubuntu and on both of them the problem exists, while in the third PC with Mint Xfce the problem does not exist. That is why I think the problem arises from KDE (Plasma), but I could very well be wrong.
The effect is that launching PCBNEW with the Board2Pdf v1.1 plugin installed KiCad suddenly closes due to a segmentation fault. I will do some more testing but I don’t think I can solve it.
All other installed plugins do not generate this problem (I have several installed). I also tried to install Board2Pdf v1.1 manually without making use of PCM but the situation is the same, a “segmentation fault” is generated.
I think @tTom when he says “If i install Board2Pdf vis PCM an start KiCad PCB KiCad dissapears…” he has exactly the same problem I am experiencing. @tTom are you using KDE plasma?
Launch kicad from terminal and see if any errors are printed when kicad crashes.
You can also run it under debugger by launching it from terminal with gdb kicad and then type in run. When it crashes it will print some useful stuff.
Now you’ve got the same error as reported earlier today.
I don’t know why you’re getting “RuntimeError: invalid key in dict”. It works fine for me, but apparently something has changed in v7.0.1 which results in some people getting this error. In the issue linked above, René gets this error on Version: 7.0.1, release build on Windows 10. He also uses the latest version of Board2Pdf and the latest version of PyMuPDF (1.21.1).
I don’t understand why it works for me, but not for you…
I’ll test on some other machines as well to see if I manage to get this error.
Platform: Linux Mint 21.1, 64 bit, Little endian, wxGTK, cinnamon, x11
Build Info:
Date: Mar 11 2023 17:01:09
wxWidgets: 3.2.1 (wchar_t,wx containers) GTK+ 3.24
Boost: 1.74.0
OCC: 7.5.2
Curl: 7.87.0
ngspice: 38
Compiler: GCC 11.3.0 with C++ ABI 1016
Build settings:
KICAD_SPICE=ON
I tried several ways to install pdfCropMargins. On the system terminal it seems to work, it was not installed as python system but on the KiCad user path were all other Plugins are. Also on the User-Python path. Once this seems to be successful with:
pip install PyMuPDF
then Kicad completely disappeared after starting PCBNEW.
So i think it is a problem with Cinnamon, as ciondo61 wrote.
KiCad 6 i tested for the first time and used Board2Pdf manually installed, really awsome tool for documentation. Many thanks dear albin. It took time to switch from windows to linux, and there is still a lot to learn for me. This year i started using Kicad and made several little boards.
Hope there is a way to get your wonderful plugin to work.
If i start KiCad at the terminal with installed Board2Pdf and starting PCBNEW: