Jefferson
Jefferson

Reputation: 69

PDFTron Library in Xamarin

I am trying to convert PDFDoc object to a pdftronprivare.PTPDFdoc object. I have read the file into the PDFDoc oject and then add a StampText to the file. But then I will be using PrepareDocToPrint method that will only take in pdftronprivare.PTPDFdoc object. My goal is to be able to send this new updated file to the printer.

Is there a way to convert PDFDoc to pdftronprivare.PTPDFdoc object?

    var docToPrint = new PDFDoc(Path.Combine(documentsPath, FileName));
    docToPrint = AddDisclaimer(docToPrint, UserName);

    pdftron.PDF.PTPrint print = new PTPrint();
//Need to Convert the object
    print.PreparedToPrint(docToPrint, new PrintDelegate(this.View), sender as NSObject);

Upvotes: 0

Views: 81

Answers (1)

Jefferson
Jefferson

Reputation: 69

Using the ConvPDFDoc class will convert PDFDoc to pdftronprivare.PTPDFdoc

var privatePdfDoc = TypeConvertHelper.ConvPDFDocToNative(docToPrint);

Upvotes: 1

Related Questions