PCB Print

Prints the PCB using a mechanism that is more flexible than pdf_pcb_print and svg_pcb_print. Supports PDF, SVG, PNG, EPS and PS formats.
If you use custom fonts and/or colors please consult the resources_dir global variable.

Type: pcb_print

Category: PCB/docs

Parameters:

  • comment : [string=’’] A comment for documentation purposes. It helps to identify the output.

  • dir : [string=’./’] Output directory for the generated files. If it starts with + the rest is concatenated to the default dir.

  • name : [string=’’] Used to identify this particular output definition. Avoid using _ as first character. These names are reserved for KiBot.

  • options : [dict] Options for the pcb_print output.

    • Valid keys:

      • color_theme : [string=’_builtin_classic’] Selects the color theme. Only applies to KiCad 6. To use the KiCad 6 default colors select _builtin_default. Usually user colors are stored as user, but you can give it another name.

      • force_edge_cuts : [boolean=false] Add the Edge.Cuts to all the pages.

      • format : [string=’PDF’] [PDF,SVG,PNG,EPS,PS] Format for the output file/s. Note that for PS you need ghostscript which isn’t part of the default docker images.

      • output : [string=’%f-%i%I%v.%x’] Filename for the output (%i=assembly, %x=pdf/ps)/(%i=assembly_page_NN, %x=svg/png/eps). Consult the page_number_as_extension and page_id options. Affected by global options.

      • output_name : Alias for output.

      • pages : [list(dict)] List of pages to include in the output document. Each page contains one or more layers of the PCB.

        • Valid keys:

          • layers : [list(dict)|list(string)|string] List of layers printed in this page. Order is important, the last goes on top. You can reuse other layers lists, some options aren’t used here, but they are valid.

            • Valid keys:

              • color : [string=’’] Color used for this layer. KiCad 6+: don’t forget the alpha channel for layers like the solder mask.

              • description : [string=’’] A description for the layer, for documentation purposes. A default can be specified using the layer_defaults global option.

              • force_plot_invisible_refs_vals : [boolean=false] Include references and values even when they are marked as invisible.

              • layer : [string=’’] Name of the layer. As you see it in KiCad.

              • plot_footprint_refs : [boolean=true] Include the footprint references.

              • plot_footprint_values : [boolean=true] Include the footprint values.

              • suffix : [string=’’] Suffix used in file names related to this layer. Derived from the name if not specified. A default can be specified using the layer_defaults global option.

              • use_for_center : [boolean=true] Use this layer for centering purposes. You can invert the meaning using the invert_use_for_center option.

          • scaling : [number=1.0] Scale factor (0 means autoscaling).

          • sort_layers : [boolean=false] Try to sort the layers in the same order that uses KiCad for printing.

          • autoscale_margin_x : [number=0] Horizontal margin used for the autoscaling mode [mm].

          • autoscale_margin_y : [number=0] Vertical margin used for the autoscaling mode [mm].

          • colored_holes : [boolean=true] Change the drill holes to be colored instead of white.

          • exclude_pads_from_silkscreen : [boolean=false] Do not plot the component pads in the silk screen (KiCad 5.x only).

          • holes_color : [string=’#000000’] Color used for the holes when colored_holes is enabled.

          • line_width : [number=0.1] [0.02,2] For objects without width [mm] (KiCad 5).

          • mirror : [boolean=false] Print mirrored (X axis inverted).

          • mirror_footprint_text : [boolean=true] Mirror text in the footprints when mirror option is enabled and we plot a user layer.

          • mirror_pcb_text : [boolean=true] Mirror text in the PCB when mirror option is enabled and we plot a user layer.

          • monochrome : [boolean=false] Print in gray scale.

          • negative_plot : [boolean=false] Invert black and white. Only useful for a single layer.

          • page_id : [string=’%02d’] Text to differentiate the pages. Use %d (like in C) to get the page number.

          • repeat_for_layer : [string=’’] Use this page as a pattern to create more pages. The other pages will change the layer mentioned here. This can be used to generate a page for each copper layer, here you put F.Cu. See repeat_layers.

          • repeat_inherit : [boolean=true] If we will inherit the options of the layer we are replacing. Disable it if you specify the options in repeat_layers, which is unlikely.

          • repeat_layers : [list(dict)|list(string)|string] List of layers to replace repeat_for_layer. This can be used to generate a page for each copper layer, here you put copper.

            • Valid keys:

              • color : [string=’’] Color used for this layer. KiCad 6+: don’t forget the alpha channel for layers like the solder mask.

              • description : [string=’’] A description for the layer, for documentation purposes. A default can be specified using the layer_defaults global option.

              • force_plot_invisible_refs_vals : [boolean=false] Include references and values even when they are marked as invisible.

              • layer : [string=’’] Name of the layer. As you see it in KiCad.

              • plot_footprint_refs : [boolean=true] Include the footprint references.

              • plot_footprint_values : [boolean=true] Include the footprint values.

              • suffix : [string=’’] Suffix used in file names related to this layer. Derived from the name if not specified. A default can be specified using the layer_defaults global option.

              • use_for_center : [boolean=true] Use this layer for centering purposes. You can invert the meaning using the invert_use_for_center option.

          • sheet : [string=’Assembly’] Text to use for the sheet in the title block. Pattern (%*) and text variables are expanded. In addition when you use repeat_for_layer the following patterns are available: %ln layer name, %ls layer suffix and %ld layer description.

          • sheet_reference_color : [string=’’] Color to use for the frame and title block.

          • sketch_pad_line_width : [number=0.1] Line width for the sketched pads [mm], see sketch_pads_on_fab_layers (KiCad 6+) Note that this value is currently ignored by KiCad (6.0.9).

          • sketch_pads_on_fab_layers : [boolean=false] Draw only the outline of the pads on the \*.Fab layers (KiCad 6+).

          • tent_vias : [boolean=true] Cover the vias.

          • title : [string=’’] Text used to replace the sheet title. %VALUE expansions are allowed. If it starts with + the text is concatenated.

      • plot_sheet_reference : [boolean=true] Include the title-block (worksheet, frame, etc.).

      • scaling : [number=1.0] Default scale factor (0 means autoscaling).

      • add_background : [boolean=false] Add a background to the pages, see background_color.

      • autoscale_margin_x : [number=0] Default horizontal margin used for the autoscaling mode [mm].

      • autoscale_margin_y : [number=0] Default vertical margin used for the autoscaling mode [mm].

      • background_color : [string=’#FFFFFF’] Color for the background when add_background is enabled.

      • background_image : [string=’’] Background image, must be an SVG, only when add_background is enabled.

      • blind_via_color : [string=’’] Color used for blind/buried colored_vias.

      • colored_pads : [boolean=true] Plot through-hole in a different color. Like KiCad GUI does.

      • colored_vias : [boolean=true] Plot vias in a different color. Like KiCad GUI does.

      • dnf_filter : [string|list(string)=’_none’] Name of the filter to mark components as not fitted. A short-cut to use for simple cases where a variant is an overkill.

      • dpi : [number=360] [36,1200] Resolution (Dots Per Inch) for the output file. Most objects are vectors, but thing like the the solder mask are handled as images by the conversion tools.

      • drill_marks : [string=’full’] [none,small,full] What to use to indicate the drill places, can be none, small or full (for real scale).

      • forced_edge_cuts_color : [string=’’] Color used for the force_edge_cuts option.

      • forced_edge_cuts_use_for_center : [boolean=true] Used when enabling the force_edge_cuts, in this case this is the use_for_center option of the forced layer.

      • frame_plot_mechanism : [string=’internal’] [gui,internal,plot] Plotting the frame from Python is problematic. This option selects a workaround strategy. gui: uses KiCad GUI to do it. Is slow but you get the correct frame. But it can’t keep track of page numbers. internal: KiBot loads the .kicad_wks and does the drawing work. Best option, but some details are different from what the GUI generates. plot: uses KiCad Python API. Only available for KiCad 6. You get the default frame and some substitutions doesn’t work.

      • hide_excluded : [boolean=false] Hide components in the Fab layer that are marked as excluded by a variant. Affected by global options.

      • individual_page_scaling : [boolean=true] Tell KiCad to apply the scaling for each page as a separated entity. Disabling it the pages are coherent and can be superposed.

      • invert_use_for_center : [boolean=false] Invert the meaning of the use_for_center layer option. This can be used to just select the edge cuts for centering, in this case enable this option and disable the use_for_center option of the edge cuts layer.

      • keep_temporal_files : [boolean=false] Store the temporal page and layer files in the output dir and don’t delete them.

      • micro_via_color : [string=’’] Color used for micro colored_vias.

      • pad_color : [string=’’] Color used for colored_pads.

      • page_number_as_extension : [boolean=false] When enabled the %i is always assembly, the %x will be NN.FORMAT (i.e. 01.png). Note: page numbers can be customized using the page_id option for each page.

      • png_width : [number=1280] [0,7680] Width of the PNG in pixels. Use 0 to use as many pixels as the DPI needs for the page size.

      • pre_transform : [string|list(string)=’_none’] Name of the filter to transform fields before applying other filters. A short-cut to use for simple cases where a variant is an overkill.

      • realistic_solder_mask : [boolean=true] Try to draw the solder mask as a real solder mask, not the negative used for fabrication. In order to get a good looking select a color with transparency, i.e. ‘#14332440’. PcbDraw must be installed in order to use this option.

      • sheet_reference_layout : [string=’’] Worksheet file (.kicad_wks) to use. Leave empty to use the one specified in the project.

      • svg_precision : [number=4] [0,6] Scale factor used to represent 1 mm in the SVG (KiCad 6). The value is how much zeros has the multiplier (1 mm = 10 power svg_precision units). Note that for an A4 paper Firefox 91 and Chrome 105 can’t handle more than 5.

      • title : [string=’’] Text used to replace the sheet title. %VALUE expansions are allowed. If it starts with + the text is concatenated.

      • variant : [string=’’] Board variant to apply.

      • via_color : [string=’’] Color used for through-hole colored_vias.

  • type : ‘pcb_print’

  • category : [string|list(string)=’’] The category for this output. If not specified an internally defined category is used. Categories looks like file system paths, i.e. PCB/fabrication/gerber. The categories are currently used for navigate_results.

  • disable_run_by_default : [string|boolean] Use it to disable the run_by_default status of other output. Useful when this output extends another and you don’t want to generate the original. Use the boolean true value to disable the output you are extending.

  • extends : [string=’’] Copy the options section from the indicated output. Used to inherit options from another output of the same type.

  • groups : [string|list(string)=’’] One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed.

  • output_id : [string=’’] Text to use for the %I expansion content. To differentiate variations of this output.

  • priority : [number=50] [0,100] Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs.

  • run_by_default : [boolean=true] When enabled this output will be created when no specific outputs are requested.