Some test text!

Type conversion

Type Conversion

PDFTron type conversion allows you to call C functions directly from C#.

Managed type and binding types

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

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


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);


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);

Get the answers you need: Support

Upcoming Webinar: Customer Experience and Retaining Control: Boosting Document Automation and Efficiency in Financial Services | Sept 15, 2022 at 11 am PT


The Platform


© 2022 PDFTron Systems Inc. All rights reserved.


Terms of Use