Astro + Starlight docs site at docs-site/ with 18 pages organized by diataxis: getting-started (intro, install, config), guides (9 how-to guides), reference (tools, batch, env vars), development (architecture, adding tools, troubleshooting). Includes Docker infrastructure following warehacking cookie-cutter pattern: multi-stage Dockerfile (Node builder -> Caddy prod / Node dev), docker-compose with caddy-docker-proxy labels, Makefile. Content migrated from docs/ markdown guides with Starlight frontmatter, cross-links updated, and full-text search via Pagefind.
3.9 KiB
| title | description |
|---|---|
| Export & Manufacturing | Generate Gerber files, drill files, PDFs, SVGs, and thumbnails |
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
| 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
Export Gerber files for my project at /path/to/project.kicad_pro
The 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
Export drill files for my project at /path/to/project.kicad_pro
The 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
Export a PDF of my PCB layout at /path/to/project.kicad_pro
The 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 schematic
The export_schematic_pdf tool provides options for black-and-white output and background exclusion.
SVG generation
Generate an SVG render of my PCB at /path/to/project.kicad_pro
The 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
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
- 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
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
- 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
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
- Check that the project contains a valid
.kicad_pcbfile - Ensure the PCB has a defined board outline (Edge.Cuts layer)
Low quality output
- Ensure the PCB has a properly defined board outline
- Update to the latest KiCad version for improved CLI export quality