KiCad-CLI - Unable to export pdf of user layers

Hi,

I’m creating a simple python workflow to generate manufacturing files, currently we’re on Kicad 8.0.3.

To maintain our company standard, I have defined some user layers:

  • User.AssemblyCommon: common for gerbers, assembly drawing, stackup drawing, and drill map.
  • User.TopAssembly: top assembly only
  • User.BottomAssembly: bottom assembly only
  • User.ManufacturingDetail: drill map, stackup drawing and board measurements

Most of it works fine, and I can export nearly everything we need.

However, I’m running into an issue with using the KiCad-CLI when trying to export user layers:

& 'C:/Program Files/KiCad/8.0/bin/kicad-cli.exe' pcb export pdf -l User.ManufacturingDetail -o 'C:/projects/pcb/output/assembly/assembly_top.pdf'  --drawing-sheet 'C:/projects/libs/A3_PCB.kicad_wks' src/board.kicad_pcb

Invalid layer name "User.ManufacturingDetail"

Running the same command with any other (non-user layers, other than User.Drawings or User.Comments) layers work fine.

Any ideas?

This is a guess, but have you tried using the standard KiCad name for that layers, and not the name you have given it?

You could also use the CLI in Board2Pdf to create pdf files. Home · Wiki · Albin Dennevi / Board2Pdf · GitLab

Thanks for the quick reply.

I have tried to use User.4, User.3, and so on, with no luck.

Thanks for recommending board2pdf, it’s quite good, I have only played around generating the assembly drawings and so far it works quite well. I need to figure out a way to integrate it into the main app.

Cheers