• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Fake NSView dimensions for fake printing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Open Recent
  • Next by Date: Re: Open Recent
  • Previous by thread: Re: [NSPredicate predicateWithFormat:]
  • Next by thread: Re: Fake NSView dimensions for fake printing
  • Index(es):
    • Date
    • Thread