Skip to main content

PcbDrawToPDF exports the masks employed by PcbDraw in order to apply masking on Adobe software and be able to save on PDF correctly.

Project description

PcbDrawToPdf

Convert the SVG files generated by PcbDraw to PDF files.

example

This tool addresses the challenge of exporting PDF files from PcbDraw, particularly related to the SVG mask property that Inkscape does not convert properly. It processes the SVG file generated by PcbDraw and produces another SVG file without the masks. The masks are exported as additional groups, allowing for their application in other software, such as Adobe Illustrator.

Installation

PcbDrawToPdf is a stand-alone CLI tool. PcbDrawToPdf is tested with Inkscape 1.3.2 and PcbDraw v1.1.2.

PcbDrawToPdf is distributed as a Python package. You just have to follow the installation instructions from PcbDraw and then install PcbDrawToPdf via Pip:

pip install PcbDrawToPdf # Use pip or pip3 based on your distribution

Now you can test that it works:

pcbdrawtopdf --help

You should get a help menu.

Usage

The input for PcbDrawToPdf is the SVG file generated by PcbDraw. This tool provides two main commands:

Commands

  • convert-masks: This command generates a new SVG file by removing the mask effects and adding the masks as additional groups within the boardContainer group. These masks must be applied in Adobe Illustrator from the lowest hierarchy level to the highest. The groups that need masking are renamed with _<mask-name>, where <mask-name> corresponds to the name of the group containing the mask.
  • extract-masks: This command generates the masks in separate files, which is useful for debugging purposes.

Mask Application

PcbDraw generates three masks: hole-mask, pads-mask-silkscreen, and pads-mask. The masks should be applied in the following order:

  1. pads-mask-silkscreen
  2. pads-mask
  3. hole-mask

This order is important because hole-mask applies to a group at a higher hierarchy level in the SVG file.

Additional Resources

For more information about applying opacity masks in Adobe Illustrator, please refer to this video.

Examples

pcbdrawtopdf convert-masks ArduinoLearningKitStarter.svg ArduinoLearningKitStarter_export.svg
pcbdrawtopdf extract-masks ArduinoLearningKitStarter.svg export_folder

Important notes

I have experienced some problems when PcbDraw exports the back side of the PCB. One of the solutions I found is to load the SVG from PcbDraw in Inkspace, select all the text objects and convert them to glyphs. To do so, follow these steps in Inkscape:

  1. Select any text object in your drawing.
  2. Then Edit > Select Same > Object Type.
  3. Afterwards Text > Text to Glyphs.
  4. Finally save the file File > Save.

Use this new SVG file with PcbDrawToPdf.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pcbdrawtopdf-0.0.5.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pcbdrawtopdf-0.0.5-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file pcbdrawtopdf-0.0.5.tar.gz.

File metadata

  • Download URL: pcbdrawtopdf-0.0.5.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for pcbdrawtopdf-0.0.5.tar.gz
Algorithm Hash digest
SHA256 94a4e78dde0d0e016dc493e549ced99250cc756da77cc5df8224abb9a58d4988
MD5 7d641446cad0b2c8af22a0f7d36d9f7a
BLAKE2b-256 a674d0fd592b5e18000ec703281d1dce996e0cf573db55f162ea63e49b3217c4

See more details on using hashes here.

File details

Details for the file pcbdrawtopdf-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: pcbdrawtopdf-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for pcbdrawtopdf-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d28caddef47fad62a51082649e7e7311aefac686b0f335b0b40b04a54a2c0429
MD5 0c5bf2cbbb6caf2bb8d156627d99a05a
BLAKE2b-256 da02dac5b2fbed6aceb872cf269ac8844f2141adef3977b0a45a9039127c7c8f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page