Hi, I am porting an application to the Mac that prints. I need to know what
margins the printer has, so that I can print right up to that line. In
windows I have used GetDeviceCaps to find out the margins of the user's
printer. How can I do this on the Mac? I am using realbasic, but posted to
the comp.sys.mac.programmer group as well, in case realbasic does not have
this capability and I will need to use something from the carbon library.
Thanks
> Hi, I am porting an application to the Mac that prints. I need to know what
> margins the printer has, so that I can print right up to that line. In
> windows I have used GetDeviceCaps to find out the margins of the user's
> printer. How can I do this on the Mac? I am using realbasic, but posted to
> the comp.sys.mac.programmer group as well, in case realbasic does not have
> this capability and I will need to use something from the carbon library.
On Macintosh, you ask the print system for the page rectangle and the
paper rectangle. The paper rectangle is the physical size of the paper,
and the page is the printable area.
The user specifies which printer, or generic, on the Page Setup dialog
box.
The user is allowed to queue a print job on one printer, then drag it
to another printer, and if he does he deserves to get what he gets.
Read: <http://developer.apple.com/documentation/Carbon/Reference/Carbon_Spec_Porting/Ca
rbon_Printing_Manager.html>
and
<http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_
Ref/cpmref_reference/function_group_3.html>
John Smith 99382 - 27 Nov 2004 21:31 GMT
Thanks, that was exactly what I needed.
John Smith 99382 - 27 Nov 2004 21:55 GMT
Well actually...would you happen to have a code snippet in realbasic that
returns the margins in inches (after the user selects the printer in the
dialog).
> Thanks, that was exactly what I needed.
Michael Szuchy - 28 Nov 2004 19:28 GMT
The PrinterSetup class in the Language Reference has an example that shows
how to do this (stupid me). I will test it out and see if it returns the
hardware margins, or just the page size.
> Well actually...would you happen to have a code snippet in realbasic that
> returns the margins in inches (after the user selects the printer in the
> dialog).
>
> > Thanks, that was exactly what I needed.