Some test text!

menu
search
Free Trial Support

Contents

Xamarin.Android
PDFDoc
Annot
Xamarin.iOS
PDFDoc
Annot

Type conversion

PDFTron for Xamarin SDK takes advantage of PInvoke which allows calling C functions from C# directly. This applies to all core classes that are shared between Xamarin.Android and Xamarin.iOS. However, the PDFViewCtrl class and PDFViewCtrlTools library are direct Xamarin bindings from the source code. This article will walk you through how to deal with managed type and binding types.

Key concepts:

  • All managed types are in pdftron namespace
  • All binding types are in pdftronprivate namespace

linkXamarin.Android

A TypeConvertHelper class is provided to convert between managed types and binding types. For example:

linkPDFDoc

From pdftronprivate.PDF.PDFDoc to pdftron.PDF.PDFDoc:

var pdfDoc = TypeConvertHelper.ConvPdfDocToManaged(privatePdfDoc);

From pdftron.PDF.PDFDoc to pdftronprivate.PDF.PDFDoc:

var privatePdfDoc = TypeConvertHelper.ConvPDFDocToNative(pdfDoc);

linkAnnot

From pdftronprivate.PDF.Annot to pdftron.PDF.Annot:

var annot = TypeConvertHelper.ConvAnnotToManaged(privateAnnot);

From pdftron.PDF.Annot to pdftronprivate.PDF.Annot:

var privateAnnot = TypeConvertHelper.ConvAnnotToNative(annot);

linkXamarin.iOS

A TypeConvertHelper class is provided to convert between managed types and binding types. For example:

linkPDFDoc

From pdftronprivate.PTPDFDoc to pdftron.PDF.PDFDoc:

var pdfDoc = TypeConvertHelper.ConvPdfDocToManaged(privatePdfDoc);

From pdftron.PDF.PDFDoc to pdftronprivate.PTPDFDoc:

var privatePdfDoc = TypeConvertHelper.ConvPDFDocToNative(pdfDoc);

linkAnnot

From pdftronprivate.PTAnnot to pdftron.PDF.Annot:

var annot = TypeConvertHelper.ConvAnnotToManaged(privateAnnot);

From pdftron.PDF.Annot to pdftronprivate.PTAnnot:

var privateAnnot = TypeConvertHelper.ConvAnnotToNative(annot);

Get the answers you need: Support

Free Trial Support

Contents

Xamarin.Android
PDFDoc
Annot
Xamarin.iOS
PDFDoc
Annot
close

Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.