--- title: "Export & Manufacturing" description: "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_pdf` with `file_type="pcb"` (default) - **Schematic PDF**: `export_pdf` with `file_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 1. **Ensure KiCad is properly installed** -- the export tools rely on kicad-cli 2. **Use absolute paths** to avoid path resolution issues 3. **Define a board outline** (Edge.Cuts layer) for proper visualization 4. **Use the latest KiCad version** for best compatibility ## Manufacturing workflow A typical flow for preparing manufacturing files: 1. Run [DRC](/guides/drc/) to verify the design has no violations 2. Export Gerber files 3. Export drill files 4. Generate a PDF for visual review 5. Check the [BOM](/guides/bom/) for component availability 6. 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 1. Verify `kicad-cli` is available in your PATH or set `KICAD_CLI_PATH` 2. Check that the project file exists and contains a valid PCB or schematic 3. Ensure write permissions in the output directory 4. Check server logs for detailed error messages ### No thumbnail generated 1. Check that the project contains a valid `.kicad_pcb` file 2. Ensure the PCB has a defined board outline (Edge.Cuts layer) ### Low quality output 1. Ensure the PCB has a properly defined board outline 2. Update to the latest KiCad version for improved CLI export quality