Print Scaling in Win

When I print from an app on a Mac, the output is fine. When I print using the same app on Win, the output is scaled down. Has anyone seen this? What am I missing? The code below gives me two different outputs.

Dim p as New PrinterSetup
Dim g As Graphics
g = OpenPrinterDialog§
g.PenWidth = 1
g.DrawRect( 0, 0, 576, 720)

What version of Xojo ?
There’s a change in how things behave around 2016r4.1

isn’t this a matter of 72dpi vs 96dpi?

well …
prior to 2016r4.1 and the move to Direct2D DirectWrite you had to scale by the horizontal resolution
since a page might at 1200 DPI be 10200 pixels across you need to scale whatever you draw by that density or it comes out tiny

In 2026r4.1 and newer Windows ALWAYS tells you the resolution is 96 regardless

Yeah, what they said, but also:
Is it the same printer??

The Drawrect is basically drawing in pixels/points (dont get me started)
On a printer that is pushing out 72 dpi, a 72 x 72 rectangle gets you a 1 inch square.
If the printer is 96dpi ( as Dave points out), your square hits the paper at about 3/4inch square.
If the printer resolution is 300 dpi, your square will be tiny.

Whatever the printer dpi is (72, 96, 150,300), the width and height of the page will adjust to match.

So when you see 96dpi , if the height is 960, you have a 10 inch page to print upon.
What you throw at that is up to you.

I’m using 2017R1.1 for OS X. I am using the same printer for testing. I’m using the rectangle as a simple example. Everything, including text, scales down when running an app on a windows machine.

your code never actually asks the printer for its resolution and implicitly uses 72 on OS X
And this is wrong for Windows which runs at 96

You’ll see this if your code did

Dim p As New PrinterSetup
Dim g As Graphics
p.MaxHorizontalResolution = -1
p.MaxVerticalResolution = -1
g = OpenPrinterDialog(p)
g.PenWidth = 1
g.DrawRect( 0, 0, 576, 720)

and now the DPI for things is much different than 72

Norman, I copied and pasted your code and get the same results. What you (and everybody else here) are saying makes sense. I just cant seem to change the resolution. I am using a regular Dell printer.

That may be because

Which frankly sounds bonkers.

But if that is the new Norm (hey dont judge me… :> ) , you need to know that 96 things equals an inch on Windows, and (probably 72) means an inch on Mac.

To get sharp images you will need to fiddle with the scale, or
create a picture which is the page size * 4 , draw on that at bigger sizes, then .drawpicture the picture onto the printer graphics.

I ran your code on OS X 10.11.6 in 2017r1.1
Initially when I print to PDF I get a rect that mostly fills the page
With my code that same rect is about 1/4 that size

My code doesn’t make it so you can change the resolution in code
You could select or set the printer to use a different DPI and that would then change how things scale

Print to PDF is handy on OS X for testing this kind of thing
This code will, regardless of resolution, make the rect 8 inches wide & 10 inches tall

Dim p As New PrinterSetup
Dim g As Graphics
p.MaxHorizontalResolution = -1
p.MaxVerticalResolution = -1
g = OpenPrinterDialog(p)
g.PenWidth = 1
g.DrawRect( 0, 0, 8 * p.HorizontalResolution, 10 * p.VerticalResolution)

Not really since drawing to a PDF is much the same
Its all virtualized

Norman, that worked! This was driving me crazy. Thanks everyone for the help.