Compositing NSViews for print
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