Export & Manufacturing
The export tools generate manufacturing and documentation files from your KiCad projects using kicad-cli. All exports run in batch mode without requiring a running KiCad instance.
Quick reference
Section titled “Quick reference”| Task | Example prompt |
|---|---|
| Export Gerbers | Export Gerber files for my project at /path/to/project.kicad_pro |
| Export drill files | Export drill files for my project |
| Export PDF | Export a PDF of my PCB layout |
| Generate SVG | Generate an SVG render of my PCB |
| Export schematic PDF | Export a PDF of my schematic |
Gerber export
Section titled “Gerber export”Export Gerber files for my project at /path/to/project.kicad_proThe export_gerbers tool runs kicad-cli pcb export gerbers and writes output into a gerbers/ subdirectory alongside the project. Returns the list of generated files and their paths.
Gerber files cover all standard layers: copper (front/back), solder mask, silkscreen, paste, and board outline.
Drill file export
Section titled “Drill file export”Export drill files for my project at /path/to/project.kicad_proThe export_drill tool runs kicad-cli pcb export drill and writes output to the gerbers/ subdirectory (following the common convention of co-locating drill files with Gerbers for fab submission).
PDF export
Section titled “PDF export”Export a PDF of my PCB layout at /path/to/project.kicad_proThe export_pdf tool supports both PCB and schematic exports:
- PCB PDF:
export_pdfwithfile_type="pcb"(default) - Schematic PDF:
export_pdfwithfile_type="schematic"
Or use the dedicated schematic PDF export with additional options:
Export a black-and-white PDF of my schematicThe export_schematic_pdf tool provides options for black-and-white output and background exclusion.
SVG generation
Section titled “SVG generation”Generate an SVG render of my PCB at /path/to/project.kicad_proThe generate_pcb_svg tool uses kicad-cli pcb export svg to produce a multi-layer SVG of the board. The SVG content is returned as a string so the caller can display or save it.
PCB thumbnails
Section titled “PCB thumbnails”The SVG export effectively serves as a PCB thumbnail. When viewing the output, you will typically see:
- Board outline (Edge.Cuts layer)
- Copper layers (F.Cu and B.Cu)
- Silkscreen layers (F.SilkS and B.SilkS)
- Mask layers (F.Mask and B.Mask)
- Component outlines and reference designators
Tips for best visual results
Section titled “Tips for best visual results”- Ensure KiCad is properly installed — the export tools rely on kicad-cli
- Use absolute paths to avoid path resolution issues
- Define a board outline (Edge.Cuts layer) for proper visualization
- Use the latest KiCad version for best compatibility
Manufacturing workflow
Section titled “Manufacturing workflow”A typical flow for preparing manufacturing files:
- Run DRC to verify the design has no violations
- Export Gerber files
- Export drill files
- Generate a PDF for visual review
- Check the BOM for component availability
- Submit the
gerbers/directory to your PCB fabricator
Integration uses
Section titled “Integration uses”- Project browsing — generate SVGs for all projects to visually identify them
- Documentation — include PCB renders in project docs
- Design review — use PDFs and SVGs to discuss layouts without opening KiCad
Troubleshooting
Section titled “Troubleshooting”Export fails
Section titled “Export fails”- Verify
kicad-cliis available in your PATH or setKICAD_CLI_PATH - Check that the project file exists and contains a valid PCB or schematic
- Ensure write permissions in the output directory
- Check server logs for detailed error messages
No thumbnail generated
Section titled “No thumbnail generated”- Check that the project contains a valid
.kicad_pcbfile - Ensure the PCB has a defined board outline (Edge.Cuts layer)
Low quality output
Section titled “Low quality output”- Ensure the PCB has a properly defined board outline
- Update to the latest KiCad version for improved CLI export quality