FROM : Jeremy Griffes
DATE : Fri Jan 03 17:14:01 2003
Hi,
I'm writing an application that needs to read the margin settings of
the paper size the user chose in the Page Setup dialog.
I pass a NSPrintInfo object to NSPageLayout's
beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextIn
fo and the NSPrintInfo object comes back to me with all the settings
correctly set to the user's choices, except for the margins. The
margins are unchanged from whatever they were before invoking the Page
Setup dialog.
Unfortunately, their appears to be no API for accessing the margin
sizes in NSPrinter.
This seems to be a problem for other cocoa apps as well. In the
TextEdit sample code, I noticed that it also does not print to the
margins accurately. It's most noticeable on small paper sizes. (Note:
to make the TextEdit app print without scaling down on smaller paper
sizes, I changed the following line in the Document.m printInfo method:
Before: [printInfo setHorizontalPagination:NSFitPagination];
After: [printInfo setHorizontalPagination:NSAutoPagination];
Does anyone know of a way to read the margins of the user's selected
paper size from Cocoa?
Thanks,
Jeremy
DATE : Fri Jan 03 17:14:01 2003
Hi,
I'm writing an application that needs to read the margin settings of
the paper size the user chose in the Page Setup dialog.
I pass a NSPrintInfo object to NSPageLayout's
beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextIn
fo and the NSPrintInfo object comes back to me with all the settings
correctly set to the user's choices, except for the margins. The
margins are unchanged from whatever they were before invoking the Page
Setup dialog.
Unfortunately, their appears to be no API for accessing the margin
sizes in NSPrinter.
This seems to be a problem for other cocoa apps as well. In the
TextEdit sample code, I noticed that it also does not print to the
margins accurately. It's most noticeable on small paper sizes. (Note:
to make the TextEdit app print without scaling down on smaller paper
sizes, I changed the following line in the Document.m printInfo method:
Before: [printInfo setHorizontalPagination:NSFitPagination];
After: [printInfo setHorizontalPagination:NSAutoPagination];
Does anyone know of a way to read the margins of the user's selected
paper size from Cocoa?
Thanks,
Jeremy
| Related mails | Author | Date |
|---|---|---|
| Jeremy Griffes | Jan 3, 17:14 | |
| Mark Piccirelli | Jan 7, 19:03 |






Cocoa mail archive

