Change Print Margins


I have a quick question. I’ve been doing some reading about printing in Xojo, but I’m struggling to find out how to change the print margins. I’m sure it’s probably really easy, but for some reason, I can’t seem to find it. LOL

How does one change the margins?


If you shared your actual printed code (before your text), it would help the reader to give clue(s)…

Also, is missing what you want to print (Text from TextEdit, Images, PDF, …)

Did you try to search for Print in the docs web site ?

At last, some information are available here .


Printing To Screen or Printer.xojo_binary_project

Hi Emily,

Thanks for the information; much appreciated! :slight_smile: Yes, I have been reading the Xojo docs and have done Google searches, etc. It seems that I keep getting conflicting information about margins. For example, on the Mac, the dialog window for changing margins doesn’t even appear, but in Windows, the users are given a choice in regards to them. (Hmm). I was wondering if there was a way to set the margins (via code) to ensure uniformity, as I will be printing mailing labels (and don’t want the user accidentally overriding the settings, messing it up.)

I hope this make sense. :slight_smile: Happy Holidays!

i think you look for printersetup.
see PrinterSetup.PageLeft
if you have a Din A4 Paper each printer have
a printable area. inside this you can do what you want.

Thank you, @Markus Rauch! Aw, that makes sense; I take a look into that.

Much appreciated. :slight_smile:


Indeed you get the margins dialog on Windows, but on Mac, you have to make your own.


next time, think twice and look how other applications do the job (if you find an application that have the feature you want to implement, of course).

Other applications have Printer Setup and Print.

With that in mind, you will had half (or more) of the work. A search start to be easy from there.

In this case, you have:

a Page have a physical size
a Print size
and thus margins.

You simply have to make changes to the print size values to modify the margins.

You never saw that as a user, but now that you are using the bright side of the Force, you have to know that :wink: