Re: WebView pdf representation - div background colours AWOL
Re: WebView pdf representation - div background colours AWOL
- Subject: Re: WebView pdf representation - div background colours AWOL
- From: "email@hidden" <email@hidden>
- Date: Tue, 11 Mar 2014 23:25:44 +0000
On 11 Mar 2014, at 18:09, Uli Kusterer <email@hidden> wrote:
> On 11 Mar 2014, at 17:12, email@hidden wrote:
>> There is WebView -drawsBackground but this has no disernable effect.
>
> That property is for the case where you want a transparent webview on screen.
>
>> Thinking again about this.
>> Perhaps I need to use an NSPrintOperation instead.
>
> Yeah, that's what I would have suggested. ISTR that PDF generation generally goes through the printing mechanism, so if you want to modify some options there, that's probably the way to go.
The WebPreferences API has the required property:
WebPreferences *webPref = [[WebPreferences alloc] initWithIdentifier:@“Foo"];
[webPref setShouldPrintBackgrounds:YES];
[self.webView setPreferences:webPref];
It appears that using an NSPrintOperation is only a necessity for PDF generation if the output scaling and pagination has to be modified.
Jonathan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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