Re: Printing with exotic margins (a basic example)
Re: Printing with exotic margins (a basic example)
- Subject: Re: Printing with exotic margins (a basic example)
- From: Brian Stern <email@hidden>
- Date: Mon, 14 May 2007 14:22:49 -0400
OK, I tried good old fashioned debugging.
I built your code. Changed pageRectForPageNumber: (not a part of
Cocoa) to rectForPage: and it works as expected.
On May 14, 2007, at 1:26 AM, Ewan Delanoy wrote:
You don't show in your code where yellowView comes from.
In fact, as the keyword "IBOutlet" suggests in
@interface MyDocument : NSDocument{
IBOutlet YellowView* yellowView;
}
this is an outlet inMyDocument.nib. And as I said in my OP, I know
that this part is set correctly because on runtime the yellow view
appears
in the main window.
In my printing code I alloc/init the NSView subclass that is
passed to
printOperationWithView and then release it at the end of the
printShowingPrintPanel method.
You need to do that only when the "printable view" must be different
from the original view. In my case yellowView is already printable
as it is,
so I don't need to create a special view for printing.
Is yellowView already added to another window?
There is no "other window" in my basic example, just the main
window.
If so that probably
won't work.
Why not ?
Ewan
the (rather simple) code below produces a blank page instead of
the
expected yellow rectangle. Is it a bug or have I done something
wrong ?
(the point of this example is to test printing with exotic margins)
You don't show in your code where yellowView comes from. In my
printing code I alloc/init the NSView subclass that is passed to
printOperationWithView and then release it at the end of the
printShowingPrintPanel method.
Is yellowView already added to another window? If so that probably
won't work.
--
Brian Stern
email@hidden
--
Brian Stern
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden