Print from schematic editor is not centered on paper

And just for kicks, I did a USletter printout and it is also shifted, like A4.

output-letter.pdf (7.6 KB)

Maybe KiCad is relying on incorrect wx defaults for letter and A4?

It might be something like that.
It would be interesting to dig into what the difference is in the printing code between board and schematic editors, as in the board editor it works correctly, in the schematic editor it doesn’t…

1 Like

Let’s try to identify which OS are affected and also which applications. Nobody has commented about the footprint and symbol editors and the Gerber viewer

It’s more difficult to see in the footprint editor, as it doesn’t have the frame on the drawing sheet.
But I guess a custom footprint with suitably sized outline could be made in order to be able to measure / visualize how the printout is placed on the paper.

The Symbol Editor does not have a print function, so you can scrap that one from your list.
The Footprint editor does have a print function, but it does not print a border, so centering is much harder to check. In the screenshot below I rotated a 2x20 header and printed it with Fit to Page to get it to fill the paper width, and it looks all right.

output_header_2x20.pdf (10.5 KB)

And for gerbers…
It’s uncommon and bad practice put a paper frame in a gerber file, but I did it anyway for this test. Added the border and printed 1:1 and it looks all right for me:


output_gerber.pdf (380.3 KB)

============
Another thing I noticed, is that only the schematic editor has a Print Preview button.
Edit: After davidrsb’s remark ( 2 posts lower) I double checked and each sub program does have a print preview, but the schematic editor has two of them

image

And the other one is one level deeper in the hierarchy.
I’m not even sure if this last one is even part of KiCad, or if it is from the printer driver itself.

1 Like

So far it seems the issue affects:

  • Schmatic editor (Not Board editor, Footprint editor or Gerber Viewer)
  • Drawing sizes A4 and US Letter (Not A3 or A5!)
  • Both 7.99 and 7.0.7
  • Linux - various distributions and window managers; fedora 38, OpenSuse, Ubuntu
  • So far at least one report that it does not affect Mac

We don’t know about windows yet.
If someone wants to test on Windows, you are more than welcome!
Test projects are in earlier posts above, or you can make a new project and print the schematic drawing sheet.

I cannot reproduce this on Windows 10 with Testing.
Ubuntu 23.04 with 7.0.7 edit: NOK. There are two levels of schematic editor print preview and the 2nd is offset

I do see on Ubuntu the the paper “shadow” in preview is very different for schematic and PCB previews.
(Yes PCB editor does have a preview, just in a different place)
This should really be shared code

Indeed. The schematic editor has two Preview buttons, while the others have “only” one. I wonder whether code behind the first preview button in the schematic editor interferes with the page layout. Maybe it tries to set some margins that it should not do at all, but just leave it to the printer driver.

Yes, agree.

And the two behave differently. On my Ubuntu 23.04, the second one which looks like the PCB editor one, is offset. I will edit my report above.
This dual preview needs to go before V8

And the “3D paper shadow” is also different, so it looks like two different code paths

edit: I checked again and Windows 10 only has one preview in Schematic.
Can @BlackCoffee or another Mac user have a careful check that Mac only has one preview in schematic or a 2nd after Print?

If I understand what you write correctly, what you see as two previews is first the preview generated by KiCad, and then in the next dialog window the preview by the OS / Desktop environment (in my case KDE Plasma).
In this case we benefit from the two different previews in that we can see that in KiCad the first step of the print data is generated correctly, but when it arrives in the system (outside KiCad) it is offset.

I don’t see the two different previews as a problem, and would rather keep it like that and not remove it for the release (8.0). There are settings you can do in the print dialog for the system which might affect the output (for example tiling of pages), and you might actually want to be able to see it both ways; as generated by KiCad and as modified by the system.

No, I am guessing something else is happening. My guess is:
Someone made a print preview for the schematic editor 20 years ago or so, and had to fiddle with offsets to orient it “properly” in the preview. Then those offsets are given to the printer driver, and it interprets the offsets differently.

The other parts of KiCad do not have this “double preview”, they just send the data to the printer driver, and it prints correctly.

But it is just a guess, and the only way to be sure is to look into KiCad’s code.

A Re-Look at Printing from:

Mac Monterey, Kicad v7.0.7

Result:

No Image Shifting or ‘Significant’ Observable ‘Print’ difference.

However, there is a Slight difference in the Grey Perimeter and White-Space between it and the Sheet’s Reference/Zone - Depends on Selected Paper Size.

Print-Button: A4, A5 and US-Letter using the ‘Print’ button are selected from a Full List of Sizes

Plot-Button: Only three Size Options were available; A, A4 and Schematic_Size. The dimensions shown in Red were taken from the “Mac’s” Preview inspector

Aside from the slight difference in White-Space (and fewer Size Selection options in Plot, everything else appears o.k.

On Mac, as with ALL printing, ‘Print btn’ presents panel with Option for Print and Setup. Print, prints it directly to printer so, if Not having already set the size option, it prints partial image and this has nothing to do with Kicad.

If selecting Setup then selecting desired size and printing from Preview, the images are as shown below…

No problems…

ADDED:

When Selecting ‘Print’ via the Print button, the image below is presented and clicking Setup presents the next image of List to choose from… Yes, it does have a Second ‘Print’ window after selecting. I always select either the PDF option or Preview Option (and click it’s Print button at bottom of Preview)

1 Like

Windows 10 Kicad 7.07. I have just taken a screenshot of the schematic preview page and It shows right hand side missing.This is after pressing print icon top left. Dunno if this tells you guys anything. :mouse:

Another finding:
(7.0.7, Lubuntu 20.04)
Selecting Postscript or SVG as output format also has the shift to right.

This is what I get when plotted as SVG, I messed up the size but you get the idea the right side is all there !
:mouse:

I agree.
The first preview is likely internally generated by KiCAD (as neither printer nor output format has been chosen at that point). It’s just a minimized view of the schematic screen.

To confirm the problem on Linux Mint, since ages and ages…
My system
Application: KiCad Schematic Editor x86_64 on x86_64
Version: 7.0.7-7.0.7~ubuntu20.04.1, release build
Libraries:
wxWidgets 3.2.1
FreeType 2.10.1
HarfBuzz 6.0.0
FontConfig 2.13.1
libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
Platform: Linux Mint 20.2, 64 bit, Little endian, wxGTK, mate, x11
Build Info:
Date: Aug 13 2023 23:14:53
wxWidgets: 3.2.1 (wchar_t,wx containers) GTK+ 3.24
Boost: 1.71.0
OCC: 7.5.2
Curl: 7.88.1
ngspice: 38
Compiler: GCC 9.4.0 with C++ ABI 1013
Build settings:
KICAD_SPICE=ON

The output
Test.pdf (170.7 KB)

The ancient bug report has woken up. PCBeditor uses Cairo for printing. Schematic has a diy process with a Cairo function used

1 Like

It seems all the “broken” pages have the Cairo drive in common, though several have mentioned the issue could be older templates. I build my own templates, which may be why I don’t see the issue documented from the installed A4 template:
image

I am currently using Windows 10 Letter 8.5x11, Legal 11x14, Tabloid 11x17 and PDF looks right when printed or plotted. I learned some time ago to use KiCad Plot when I’m experiencing issues. It’s fast, produces searchable text, and uses the KicadPDF driver which seems to always work. The Print function is apparently using some non-KiCad software/code and is difficult for developers to maintain. Plot is apparently significantly easier to maintain and so far just works nicely. Plot produces correct output from Windows, Ubuntu, & Raspian Linux to PDF and to my Epson ET-16650 printer which supports the paper formats in the first sentence of this paragraph.

From Plot (my simple KiCad test concepts schematic):

This leaves me wondering why the current print implementation exists when plot seems to work and is easier to maintain?