简体   繁体   中英

How to print PDF file already opened in QLPreviewController using print button?

I get binary array then convert it and save in Documents folder and then showed in QLPreviewController. I have seen the right button on the tool bar of QLPreviewController.

I want to print that is in the preview right now. But when i tab error occurs

*** Assertion failure in -[UIDocumentInteractionController setURL:], /SourceCache/UIKit_Sim/UIKit-2380.17/UIDocumentInteractionController.m:960

Also please guide me about printing that document. I have read about UIPrintInteractionController.

Why this Error occurs because you have set the URL wrong. You are setting url like that;

/Users/akrama2/Library/Application%20Support/iPhone%20Simulator/6.1/Applications/59356D13-C021-431F-A5D2-B8CD16E2B301/Documents/Application_Report.pdf

Where as UIDocumentationController task URL as:

file://localhost/Users/akrama2/Library/Application%20Support/iPhone%20Simulator/6.1/Applications/59356D13-C021-431F-A5D2-B8CD16E2B301/Documents/Application_Report.pdf

This minor mistake will made you mad ;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM