gpt4 book ai didi

ios - 使用 wkWebView iOS 10 打印预览问题

转载 作者:行者123 更新时间:2023-11-29 11:50:42 31 4
gpt4 key购买 nike

我必须打印包含英文和阿拉伯文文本的 55 页大文档。我正在使用 WKWebView.viewPrintFormattor。在 iOS 9 中,文档打印正确,但在 iOS 10 中,我在打印预览中看到空白页。

enter image description here

最佳答案

这对我有用:

func presentPrintControllerForWebView(_ webView: WKWebView)
{
guard let urlCheck = webView.url
else {return}

let pi = UIPrintInfo.printInfo()
pi.outputType = .general
pi.jobName = urlCheck.absoluteString
pi.orientation = .portrait
pi.duplex = .longEdge

let printController = UIPrintInteractionController.shared
printController.printInfo = pi
printController.showsPageRange = true
printController.printFormatter = webView.viewPrintFormatter()
printController.present(animated: true, completionHandler: nil)
}

关于ios - 使用 wkWebView iOS 10 打印预览问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41286729/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com