-
Re: WKWebView print: (macOS) is blank?
crystalminds Jul 12, 2017 2:11 PM (in response to Macho Man Randy Savage)Did you find any? I am having the exact same problem. You should be able to print a web page.
-
Re: WKWebView print: (macOS) is blank?
cadu vieira Jun 21, 2018 11:36 AM (in response to Macho Man Randy Savage)I'm having this problem and I can not find anything in the documentation, any tips ?
-
Re: WKWebView print: (macOS) is blank?
cadu vieira Jun 21, 2018 11:54 AM (in response to Macho Man Randy Savage)This is soluction:
go to Capabilities -> AppSandbox -> check all Network options
-
Re: WKWebView print: (macOS) is blank?
Macho Man Randy Savage Jun 21, 2018 12:14 PM (in response to cadu vieira)>This is soluction:
>go to Capabilities -> AppSandbox -> check all Network options
I hope that Apple considers that a workaround and not intended behavior... Where do you see AppSandbox? In System preferences? Is that new in Mojave?
Just to add a bit more info. I wrote a little Markdown editor and used WKWebView to show a preview of the rendered markdown. Couldn't get print to work at all. As mentioned in the original post I was regretting using WK. Rather than rewriting it in the old school webview I just reloaded the page in an offscreen old school Webview if the user hit print. Wasn't thrilled about that workaround. I think I filed a bug on this. Can't remember.
Now that they are getting rid of WebView I hope they fix printing on WK before that.
If I have to show an NSAlert when the user hits print and say "Go to Capabailities -> App Sandbox -> check all network options to print" I swear to G odddddd....
-
Re: WKWebView print: (macOS) is blank?
TheCD Jun 21, 2018 4:03 PM (in response to Macho Man Randy Savage)@cadu vieira is referring to settings in Xcode. Go to the target settings in Xcode, go to the Capabilities tab, and turn on the appropriate options in the App Sandbox section.
-
Re: WKWebView print: (macOS) is blank?
Macho Man Randy Savage Jun 22, 2018 4:14 AM (in response to TheCD)Ah nice. Sounds like this will be fixed in 10.14.
-
Re: WKWebView print: (macOS) is blank?
digitalmoksha Jul 5, 2019 8:57 AM (in response to Macho Man Randy Savage)This does not seem to be fixed on 10.14, even with the `com.apple.security.print`, `com.apple.security.network.client`, and `com.apple.security.network.server` entitlements enabled. Still always get blank.
WKWebView is certainly a pain - you can't load load images/resources without jumping through hoops (at least in a sandboxed app).
Will still use a legacy webview for printing for now...
-
Re: WKWebView print: (macOS) is blank?
Macho Man Randy Savage Jul 8, 2019 6:20 AM (in response to digitalmoksha)If you are implementing any sort of features beyond just displaying a web page, WKWebview is really frustating to use all around.
-
-
-
-
-
Re: WKWebView print: (macOS) is blank?
Judah Ben-Hur Nov 6, 2018 8:55 AM (in response to cadu vieira)I'm also having this problem, but I'm not trying to load a web page, but instead a locally generated HTML document.
-
-
Re: WKWebView print: (macOS) is blank?
-m- Sep 4, 2019 9:08 PM (in response to Macho Man Randy Savage)Based on related links the issues does not appear to be resolved:
- WebKit Bugzilla: PDF not rendering in WKWebView on macOS https://bugs.webkit.org/show_bug.cgi?id=197748
- Open Radar: No Method of Printing WKWebViewhttp://www.openradar.me/23649229
- GitHub: https://github.com/marc-medley/WKWebView-Printing-Puzzle
At least not resolved for me on macOS 10.14.6 (18G95) with Xcode 10.3
-
Re: WKWebView print: (macOS) is blank?
john daniel Sep 6, 2019 7:07 PM (in response to -m-)Someone on the Apple WebKit team tweeted about WKWebKit and I specifically asked about printing: twitter.com/bradeeoh/status/1136358340605251584
Although I did get a response, it was rather cryptic: "We have this request locked down."
I don't know what that means.