Essentially, I have these questions, exemplified later on in this post:
- How do I get PDF plots (for UV photoresist PCB development) of front and back copper layers with accurate size?
- How do I get PDF plots of front and back copper layers without missing pads?
I’ve seen the related question Print & Plot problems: pads missing & wrong size - Layout - KiCad.info Forums - but this also has a simplified test (and a hack fix), so I thought I’d post this separately.
Here is a little test I’ve done; the version I use is:
Application: pcbnew
Version: (2017-11-13 revision d98fc85)-master, release build
Libraries:
wxWidgets 3.0.2
libcurl/7.35.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 librtmp/2.3
Platform: Linux 4.4.0-116-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
Boost: 1.54.0
Curl: 7.35.0
Compiler: GCC 4.8.4 with C++ ABI 1002
Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=OFF
KICAD_SPICE=OFF
Open pcbnew
standalone. First “Place”/“Footprint”, and add a Pin_Headers:Pin_Header_Straight_1x03_Pitch2.54mm
footprint.
Again “Place”/“Footprint”, and add a Resistors_SMD:R_0603_HandSoldering
footprint:
Then have your track settings on default (for me, 0.250 mm (9.84 mils)) and grid settings too (for me 0.0254 mm (1.00 mils) and do “Route”/“Single Track”, and connect the outer pins of the header with the pads of the resistor:
Then, change to Grid: 5.000 mm (196.85 mils), select the Edge.Cuts layer, and draw an outline with “Place”/“Lines” - for me it turns out to be 35x20 mm in size:
Now, choose “File”/“Plot”, choose Plot Format: PDF; have only F.Cu and B.Cu layers selected; and uncheck “Exclude PCB edge layer from other layers” - and finally click on Plot:
Open the generated PDF file in a PDF viewer - here evince
, set the view zoom to 100%:
Now I’ll use the screenruler
application in Linux; note that:
on my Ubuntu 14.04,
xdpyinfo
reports 1366x768 pixels (361x203 millimeters), that turns out to be 96.1119 x 96.0945 ppi;screenruler
by default is set to “System Settings” for the resolution, which reads 96 x 96 pi (no floats accepted). However, when I put an actual ruler next to screenruler, thescreenruler
has a smaller “cm”.Then, if I use
xrandr
I get: “eDP1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 293mm x 164mm”; which turns out to 118.418 x 118.946 ppi, and setting that for ppi forscreenruler
works (as in, the cm on screen is much closer to a cm of the physical ruler).
So, with this setting of screenruler
, I get that the size of the box is something like 29 x 16 mm, where it should be 35x20 mm:
Rounding and imprecision errors notwithstanding, this is quite a ways off. Let’s try confirm that with PDF Xchange Viewer, where we can choose “Tools”/“Measuring Tools”/“Distance Tool”/“Show Comments Styles Palette”; there for the Default Style choose 1 cm for “Ratio Unit (from)” and 1 cm for “Ratio Unit (to)”; close the “Comments Styles Palette” window; and then “Tools”/“Measuring Tools”/“Distance Tool”/“Default Style”, then draw measuring lines - for me, this shows 3.49 x 1.99 cm, which is quite close to where it should be, 35x20 mm:
Anyways, let’s try to print this PDF on a printer - I’m printing using evince
:
Notice two problems here:
- 1 pad of the 1x3 pin header, and both pads of the SMD resistor, are MISSING from the printout!
- The size of the physical paper printout, as measured by a physical ruler, is something like 31x18 mm, not quite the intended 35x20 mm (and just as far from the 29 x 16 mm estimate by screen ruler)…
This with the missing pads, can also be shown like this - first, open the PDF in inkscape (0.92):
inkscape ~/noname-F.Cu.pdf
On the resulting “PDF Import Settings” screen, choose the defaults “Internal import”, “Replace PDF fonts by closest-named installed fonts”, “Embed images”; then the file opens in Inkscape, it will still show the pads:
First, save this file as Inkscape SVG .svg
, and then save as Portable Document Format .pdf
file named noname-F.Cu-inkscape.pdf
; in the “Portable Document Format” settings window choose the defaults (Restrict to PDF version: PDF 1.5; Convert text to paths; output page size: Use document’s page size; Bleed/margin 0.0 mm). Now, if you open ~/noname-F.Cu-inkscape.pdf
in evince
, you do get missing pads:
And I think I know why this happens: note that if you open ~/noname-F.Cu.svg
in inkscape, you still see all pads; however, note that the stroke-widths
used by this file are:
$ sed -n 's/.*\(stroke-width[^;]*\).*/\1/p' ~/noname-F.Cu.svg | sort | uniq
stroke-width:0.0003937
stroke-width:59.05509949
stroke-width:669.29101562
stroke-width:98.42520142
That is, there is one stroke-width
setting that is extremely small (0.0003937), but not quite zero - and it turns out, only the “missing” pads have this stroke/line width. If you now open the .svg in a text editor; look up “stroke-width:0.0003937” and replace it with “stroke-width:0.0” everywhere (and save and close the text editor), then open this in inkscape and export PDF (say ~/noname-F.Cu-inkscape2.pdf
) from this, then this PDF will show the missing pads in evince
fine - and they will be printed on paper too.
So, to repeat my questions:
- How do I get PDF plots (for UV photoresist PCB development) of front and back copper layers with accurate size?
- How do I get PDF plots of front and back copper layers, without missing pads?