Some test text!

Search
Hamburger Icon

iOS / Guides / Print a document

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:

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

where MyPrintDelegate is:

class MyPrintDelegate: NSObject, PTPrintDelegate {
    
    let view: UIView
    
    init(_ view: UIView) {
        self.view = view
    }
    
    func prepared(toPrint docFilePath: String!, userData: Any!) {
        let myPrint = PTPrint()
        myPrint.printDoc(docFilePath, from: .zero, in: self.view, withJobName: docFilePath, animated: true, completionHandler: nil)
    }
    
}

Get the answers you need: Chat with us