I’m writing a plug-in based on the pcbnew python API to generate automatically all internal documents needed for PCB ordering and quality management, but I’m struggling with the PDF page format.
When I execute the following code, the plot on the page is not centered and the scale is too big (part of the drawing sheet is missing); even if the SetAutoScale is set to True. Moreover, the layer is printed in white, so it is not visible (white on white). I noticed that because I see some objects when I select everything on the pdf. Note that when I change the option SetBlackAndWhite to True, then the layer is well printed into black.
Do you know how to scale and offset the plot on the page?
About the color issue is there some setting I’m missing?
I tried to do the same with the Command Line Interface, but then the layer name is not printed on the drawing sheet.
Any link to an example or documentation is of course welcome.
Thanks for your help.
Best regards
Although I’ve written a handful of Plugin’s for my own needs, I know Nothing about making one for Plotting so, this may not help but, will mention it…
re: v6 (and may apply to v7) To successfully Plot either SVG or PDF, the only way it works for me is to Set the Units to INCHes and Origin to ABSOLUTE. With those set, I can plot correctly, and the Negative Checkbox works with these set…
Thus, I suggest testing the Plotting of PDF/SVG from the PCB first, then if successful, ensure your Code sets plot/units/origin…etc
Test Example below shows the PCB and the Plotted Front layer
Dear BlackCoffee,
Anyway thanks trying to help me, I appreciate it. Unfortunately, when I plot “manually” from the PCB, with the same checkbox settings, everything goes well : layer color is there, drawing is perfectly centered and scaled. CLI behaves also well, the only missing information here is the layer name. I only have those color and position issues with the python API.
I hope it’s only a my misunderstanding or a setting issue, but I’m afraid that the API is still under development and some bugs still exist …
Thanks for your help
Best regards
I downloaded the Albin Board2Pdf plugin and it works fine. Not color issue, not off-centering. Thanks for sharing this link. I can now dig into this code and find the right pcbnew settings.
It’s great to have such example for my project, thanks again