Fake NSView dimensions for fake printing
Fake NSView dimensions for fake printing
- Subject: Fake NSView dimensions for fake printing
- From: Scott Garner <email@hidden>
- Date: Tue, 28 Jun 2005 11:18:38 -0500
I'm attempting to save the content of a WebView initialized with:
fakeWebView = [[WebView alloc] initWithFrame: NSMakeRect (0,0,0,0)];
As a non-paginated PDF using:
documentView = [[[fakeWebView mainFrame] frameView] documentView];
...
[[documentView dataWithPDFInsideRect:[documentView frame]]
writeToFile:saveFilePath atomically:YES];
This works fairly well, but since the size of the Rect is effectively
0x0, I sometimes get strange results.
I think solution is to pass reasonable dimensions to the initial
NSMakeRect(), but I'm not sure what to pass. The height can remain
zero, but for the width I'd like to emulate portrait and landscape
printing sizes. How should I calculate these sizes? Would it be
reasonable to calculate based on 72 DPI (8.5*72=612,11*72=792) or is
there a more logical approach that I'm missing?
Scott
_______________________________________________
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