1
我必須打印包含英文以及阿拉伯文字的55頁大文件。我正在使用WKWebView.viewPrintFormattor
。在iOS 9中,文檔打印正確,但在iOS 10中,我在打印預覽中獲得了空白頁面。打印預覽問題使用wkWebView iOS 10
我必須打印包含英文以及阿拉伯文字的55頁大文件。我正在使用WKWebView.viewPrintFormattor
。在iOS 9中,文檔打印正確,但在iOS 10中,我在打印預覽中獲得了空白頁面。打印預覽問題使用wkWebView iOS 10
這個工作對我來說:
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)
}
難道我的解決方案的工作? – Randy
@Randy @Randy我使用相同的代碼,即我爲ios 10工作,但將爲ios 9工作。我有一個包含表標記的html,表標記內有阿拉伯文和英文文本。 – Saood
你介意分享你想打印的文件嗎? – Randy