A CLI tool that exports KiCad PCB files to PDF after filling all zones.
This solves the limitation in KiCad 9.x where kicad-cli pcb export pdf does not fill zones before exporting. (The --check-zones flag was added in KiCad 10.)
- KiCad 9.x installed (uses KiCad's Python scripting API)
- macOS or Linux
# Clone or download, then:
./install.sh
# To uninstall:
./uninstall.shThe install script creates a symlink in ~/.local/bin (or /usr/local/bin if writable).
If ~/.local/bin is not in your PATH, add it:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc# Basic usage
./kicad-export-pdf board.kicad_pcb -o output.pdf
# Specific layers
./kicad-export-pdf board.kicad_pcb -o output.pdf --layers F.Cu,B.Cu
# Use a preset
./kicad-export-pdf board.kicad_pcb -o output.pdf --layers outer
# Skip zone filling (if already filled)
./kicad-export-pdf board.kicad_pcb -o output.pdf --no-fill
# Verbose output
./kicad-export-pdf board.kicad_pcb -o output.pdf -v| Preset | Layers |
|---|---|
copper |
F.Cu, B.Cu |
outer |
F.Cu, B.Cu, F.SilkS, B.SilkS, F.Mask, B.Mask, Edge.Cuts |
fab |
F.Fab, B.Fab, Edge.Cuts |
assembly |
F.Fab, B.Fab, F.SilkS, B.SilkS, Edge.Cuts |
all-copper |
All enabled copper layers |
positional arguments:
input Input .kicad_pcb file
options:
-h, --help show this help message and exit
-o, --output OUTPUT Output PDF file path (required)
-l, --layers LAYERS Comma-separated layer names or preset
--no-fill Skip zone filling
--mirror Mirror the output
--negative Negative plot
--bw Black and white output
--no-values Exclude component values
--no-refs Exclude reference designators
--frame Include border and title block
-v, --verbose Verbose output
If the wrapper script doesn't find KiCad's Python, you can run directly:
# macOS
/Applications/KiCad/KiCad.app/Contents/Frameworks/Python.framework/Versions/Current/bin/python3 \
kicad_export_pdf.py board.kicad_pcb -o output.pdf
# Or set KICAD_PYTHON
export KICAD_PYTHON=/path/to/kicad/python3
./kicad-export-pdf board.kicad_pcb -o output.pdf#!/bin/bash
# Example: export all PCBs in a directory
EXPORT_SCRIPT="./kicad-export-pdf"
for pcb in pcbs/*.kicad_pcb; do
name=$(basename "$pcb" .kicad_pcb)
$EXPORT_SCRIPT "$pcb" -o "output/${name}.pdf" --layers outer -v
done- Loads the PCB using KiCad's
pcbnewPython module - Creates a
ZONE_FILLERand fills all zones - Uses
PLOT_CONTROLLERto export to PDF - The filled zones are included in the PDF output
The zones are filled in memory only - the original .kicad_pcb file is not modified.
MIT