Re: Margin Size Inconsistencies FYI
Re: Margin Size Inconsistencies FYI
- Subject: Re: Margin Size Inconsistencies FYI
- From: glenn andreas <email@hidden>
- Date: Wed, 2 Nov 2005 15:36:43 -0600
On Nov 2, 2005, at 3:12 PM, John MacMullin wrote:
I have the following elemental code in my test printing application:
NSPrintInfo * printInfo = [self printInfo];
[printInfo setUpPrintOperationDefaultValues];
NSSize selectedPaperPrintSize = [printInfo paperSize];
NSLog(@"%@ paperName", [printInfo paperName]);
NSLog(@"%f selectedPaperPrintSize.height",
selectedPaperPrintSize.height);
NSLog(@"%f selectedPaperPrintSize.width",
selectedPaperPrintSize.width);
NSLog(@"%f topMargin", [printInfo topMargin]);
NSLog(@"%f bottomMargin", [printInfo bottomMargin]);
NSLog(@"%f leftMargin", [printInfo leftMargin]);
NSLog(@"%f rightMargin", [printInfo rightMargin]);
This code produces the following ordinary and expected information:
2005-11-02 13:40:26.733 TextPrintingStuff[17404] Letter paperName
2005-11-02 13:40:26.734 TextPrintingStuff[17404] 792.000000
selectedPaperPrintSize.height
2005-11-02 13:40:26.734 TextPrintingStuff[17404] 612.000000
selectedPaperPrintSize.width
2005-11-02 13:40:26.734 TextPrintingStuff[17404] 90.000000 topMargin
2005-11-02 13:40:26.734 TextPrintingStuff[17404] 90.000000
bottomMargin
2005-11-02 13:40:26.734 TextPrintingStuff[17404] 72.000000 leftMargin
2005-11-02 13:40:26.734 TextPrintingStuff[17404] 72.000000 rightMargin
However, after selecting the Page Setup menu item, the Page Setup
Settings Summary provides that the top, left and right margins are .
25 inch and the bottom margin is .56 inch. The Settings Summary
shows similar inconsistencies for the other paper sizes selected.
You're comparing two different things.
printInfo returns the value used by the application (and can be
changed programatically to something else). These values you're
seeing are just the defaults (designed to be fairly large for some
reason).
Page Setup shows what the printer's physical margins are (the
imagable area) which are determined by the printer (and is a hard
constraint based on the paper size, paper feed, etc...).
The margins specified in your printInfo can be changed to cover a
larger area than the printer's imagable area, but that will result in
the edges being clipped by the printer (after all, if the print head
can't move closer than .25" from the edge, sending data to be printed
there isn't going to print).
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
Widgetarium | the quickest path to widgets
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden