Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / November 2004



Tip: Looking for answers? Try searching our database.

How to determine hardware printer margins in Mac OSX?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Smith 99382 - 27 Nov 2004 20:40 GMT
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
David Phillip Oster - 27 Nov 2004 21:22 GMT
> 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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.