print shift problem

I have a print shift problem on Windows.
I have a printing tool that has been working for many years.
On Windows 10, Xojo 2016r3, everything is printed about 5mm too high up and left. The print format is correct, that of the selected printer. The margins (TopLeft, …) are usual.
The same Mac printing works without shifting.
What can I look for?

Care to share the two results ?
(either images or pdf)

try this on a Mac and on a PC (Win 10), with Xojo 2016r3

Dim g As Graphics
Dim p As PrinterSetup
p = New PrinterSetup
If p.PageSetupDialog Then
g = OpenPrinterDialog§
If g <> Nil Then
g.PenHeight = 3
g.PenWidth = 3
g.DrawRoundRect(10, 10,g.Width-20, g.Height-20, 30,30)
#if TargetWindows
g.DrawString(“Win”, 50, 50)
#endif
#if TargetMacOS
g.DrawString(“Mac”, 50, 50)
#endif
End If
End If

The result is not the same on Windows, on the printed paper, there is an offset of about 5mm on top and left.

Indeed Mac and Windows on the same printers have different offsets.

I solved that by having two extra values for print, shiftLeft and shiftTop, which I add to Left and Top upon drawing the graphics. They allow me to move up and down, and left and right the entire printing.

Found !
When you put all marges = 0 in the Windows p.PageSetupDialog, Xojo 2016r3 or r41 gives PrinterSetup.PageLeft = -12 and PageTop = -12
–> you MUST have margins >= 4,2 mm = 12 pixels (at 72ppp)
On Mac, there’s no issue, PrinterSetup.PageLeft = 0 and PageTop = 0 when margins = 0