Printing a PDF on iOS

Apryse SDK supports printing. The library handles all the hard work, you simply have to tell it to show the system print dialog with a document. This can be done with Print.startPrintJob.

Here is how:

1func handlePrintJob(sender: Any?) {
2 let print = PTPrint()
3 print.prepareDoc(toPrint: self.pdfDoc, delegate: MyPrintDelegate(self.view), userData: sender)
4}

where MyPrintDelegate is:

1class MyPrintDelegate: NSObject, PTPrintDelegate {
2
3 let view: UIView
4
5 init(_ view: UIView) {
6 self.view = view
7 }
8
9 func prepared(toPrint docFilePath: String!, userData: Any!) {
10 let myPrint = PTPrint()
11 myPrint.printDoc(docFilePath, from: .zero, in: self.view, withJobName: docFilePath, animated: true, completionHandler: nil)
12 }
13
14}

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales