Some test text!

Search
Hamburger Icon

Xamarin / Guides

Print

Apryse SDK supports printing.

Printing a PDF document in Xamarin.iOS

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.PrintDoc. Here is how:

void handlePrintJob()
{
    pdftron.PDF.PTPrint print = new PTPrint();
    print.PrepareDocToPrint(mPdfDoc, new MyPrintDelegate(this.View), btnPrint as NSObject);
}

where MyPrintDelegate is:

public class MyPrintDelegate : pdftron.PDF.PTPrintDelegate
{
    private UIView _view;
    public MyPrintDelegate(UIView view) 
    {
        _view = view;
    }
    public override void PreparedToPrint(string docFilePath, NSObject userData)
    {
        var myPrint = new pdftron.PDF.PTPrint();
        myPrint.PrintDoc(docFilePath, CGRect.Empty, _view, docFilePath, true, null);
    }
}

Get the answers you need: Chat with us