From 3acaa425740658045e0f1ecda7220e7dc6f7d2e3 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Thu, 25 Nov 2021 11:31:23 -0300 Subject: [PATCH] Added in SCH PDF Print: monochrome and no frame options. --- CHANGELOG.md | 3 ++- README.md | 2 ++ docs/samples/generic_plot.kibot.yaml | 4 ++++ kibot/out_pdf_sch_print.py | 11 ++++++++++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce0177dc..4bd2645e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - PDF PCB Print: option `hide_excluded` to hide components marked by the `exclude_filter`. https://forum.kicad.info/t/fab-drawing-for-only-through-hole-parts/ +- PCB PDF Print: mechanism to change the block title. (#102) - Internal BoM: option to avoid merging components with empty fields. Is named `merge_both_blank` and defaults to true. - Internal BoM: when a `Value` field can't be interpreted as a `number+unit`, @@ -25,8 +26,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Excellon drill: added `route_mode_for_oval_holes` option. - Default global `dir` option. - Pattern to expand the variant name: %V -- PCB PDF Print: mechanism to change the block title. (#102) - 3D view render +- SCH PDF Print: monochrome and no frame options. ### Changed - Internal BoM: now components with different Tolerance, Voltage, Current diff --git a/README.md b/README.md index 836ebd2c..d3a50d5e 100644 --- a/README.md +++ b/README.md @@ -1320,6 +1320,8 @@ Next time you need this list just use an alias, like this: * Valid keys: - `dnf_filter`: [string|list(string)=''] Name of the filter to mark components as not fitted. A short-cut to use for simple cases where a variant is an overkill. + - `frame`: [boolean=true] Include the frame and title block. + - `monochrome`: [boolean=false] Generate a monochromatic PDF. - `output`: [string='%f-%i%v.%x'] Filename for the output PDF (%i=schematic %x=pdf). Affected by global options. - `variant`: [string=''] Board variant to apply. Not fitted components are crossed. diff --git a/docs/samples/generic_plot.kibot.yaml b/docs/samples/generic_plot.kibot.yaml index 74d6da0f..0dacad33 100644 --- a/docs/samples/generic_plot.kibot.yaml +++ b/docs/samples/generic_plot.kibot.yaml @@ -918,6 +918,10 @@ outputs: # [string|list(string)=''] Name of the filter to mark components as not fitted. # A short-cut to use for simple cases where a variant is an overkill dnf_filter: '' + # [boolean=true] Include the frame and title block + frame: true + # [boolean=false] Generate a monochromatic PDF + monochrome: false # [string='%f-%i%v.%x'] Filename for the output PDF (%i=schematic %x=pdf). Affected by global options output: '%f-%i%v.%x' # [string=''] Board variant to apply. diff --git a/kibot/out_pdf_sch_print.py b/kibot/out_pdf_sch_print.py index d79b22f6..34ea6bbe 100644 --- a/kibot/out_pdf_sch_print.py +++ b/kibot/out_pdf_sch_print.py @@ -34,6 +34,10 @@ class PDF_Sch_PrintOptions(VariantOptions): with document: self.output = GS.def_global_output """ Filename for the output PDF (%i=schematic %x=pdf) """ + self.monochrome = False + """ Generate a monochromatic PDF """ + self.frame = True + """ Include the frame and title block """ super().__init__() self.add_to_doc('variant', "Not fitted components are crossed") self._expand_id = 'schematic' @@ -57,7 +61,12 @@ class PDF_Sch_PrintOptions(VariantOptions): else: sch_dir = None sch_file = GS.sch_file - cmd = [CMD_EESCHEMA_DO, 'export', '--all_pages', '--file_format', 'pdf', sch_file, output_dir] + cmd = [CMD_EESCHEMA_DO, 'export', '--all_pages', '--file_format', 'pdf'] + if self.monochrome: + cmd.append('--monochrome') + if not self.frame: + cmd.append('--no_frame') + cmd.extend([sch_file, output_dir]) cmd, video_remove = add_extra_options(cmd) ret = exec_with_retry(cmd) if ret: