• 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
Compositing NSViews for print
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compositing NSViews for print


  • Subject: Compositing NSViews for print
  • From: Warren Burton <email@hidden>
  • Date: Wed, 12 Jan 2005 12:38:26 +0000

Ive got this code in my app to generate a PDF of a web page.

- (id)sender
{
NSString *path = @"~/Desktop/Page.pdf";
path = [path stringByExpandingTildeInPath];
WebFrameView *dv = [[[myWebView mainFrame] frameView] documentView];
NSPrintInfo *info = [NSPrintInfo sharedPrintInfo];
NSMutableData *data = [NSMutableData dataWithCapacity:1024];
//relevant stuff
id op = [NSPrintOperation PDFOperationWithView:dv insideRect:[dv bounds] toData:data printInfo:info]
[op runOperation];
[op deliverResult];
if([data length]) [data writeToFile:path atomically:YES];
}

This only gives a PDF of the uppermost layer, ie some backgrounds dont appear in the PDF. How can I composite the view and its subviews into one layer so that I get a true snapshot of the page. I dont want it ripped to pixels either as I want the text info intact.




 _______________________________________________
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

  • Follow-Ups:
    • Re: Compositing NSViews for print
      • From: Evan Schoenberg <email@hidden>
  • Prev by Date: [Newbie] Drag'n drop on doc icon?
  • Next by Date: Re: [Newbie] Drag'n drop on doc icon?
  • Previous by thread: Re: [Newbie] Drag'n drop on doc icon?
  • Next by thread: Re: Compositing NSViews for print
  • Index(es):
    • Date
    • Thread