Running sample projects

A demo license key or a commercial license key is required to proceed. If you have not yet received a license key, please obtain a license key here before continuing to read this documentation.

To run each of the samples, first, add your PDFTron license key to \samples\Common\Key.cs file:

public static string LicenseKey = "your_license_key_goes_here";

Xamarin.Android samples

PDFTron for Xamarin.Android ships with three sample projects each containing examples that you could use in your project. All samples are included in the download package under \samples folder. You can run any of the sample projects using Visual Studio.

  • Open \projectSrc\PDFNetAndroidXamarin\PDFNetAndroidXamarin.sln or the .csproj file for project of interest in latest version of Visual Studio.
  • Select the project of interest as the startup project.
  • Clean and build the project.
  • Choose a deploy target, either a device or an emulator, then deploy to device.

CompleteReader project

This sample shows how to use SimpleReaderActivity and how to change its configuration. SimpleReaderActivity is an all-in-one document reader and PDF editor. In addition to PDF files, it also supports viewing of other file extensions such as .docx, .doc, .pptx, .xlsx, .md, .cbz and various image formats. It allows stream conversion of these non-pdf documents to PDF format so you can view the document while conversion happens. In this activity, you can read, annotate, sign, fill in PDF forms and more.

Download sample APK here: APK for x86, APK for armeabi-v7a.

PDFNetAndroidXamarinSample project

This sample shows how to use PDFViewCtrl to make a universal viewer that supports PDF files as well as other file extensions such as .docx, .doc, .pptx, .xlsx, .md, .cbz and various image formats. It supports annotating on PDF files. It also has code snippets such as showing how to add a custom view on a PDF page, how to find text, how to hide tools from QuickMenu and AnnotationToolbar, how to show reflow mode, night mode etc.

AndroidMiscellaneousSamples project

This app shows the functionalities of the PDFTron SDK and includes the samples found in the sample code page. Inspect its source code to learn how to use some of the main classes and features of the SDK, or just run the sample and check the results.

This project shares all of its source code with iOSMiscellaneousSamples project.

Xamarin.iOS samples

PDFTron for Xamarin.iOS ships with two sample projects each containing examples that you could use in your project. All samples are included in the download package under \samples folder. You can run any of the sample projects via Visual Studio.

  • Open \projectSrc\PDFNetiOSXamarin\PDFNetiOSXamarin.sln or the .csproj file for project of interest in latest version of Visual Studio.
  • Select the project of interest as the startup project.
  • Clean and build the project.
  • Choose a deploy target, either a device or an simulator, then deploy to device.

PDFNetiOSXamarinSample project

This sample shows how to use PDFViewCtrl to make a PDF viewer and annotator. It also has code snippets such as showing how to use AnnotationToolbar, bookmark controls etc.

iOSMiscellaneousSamples project

This app shows the functionalities of the PDFTron SDK and includes the samples found in the sample code page. Inspect its source code to learn how to use some of the main classes and features of the SDK, or just run the sample and check the results.

This project shares all of its source code with AndroidMiscellaneousSamples project.

Xamarin.Forms sample

This sample shows how to use PDFTron for Xamarin in Xamarin.Forms project via PageRenderer. You can run this sample on Android, iOS and UWP. It shows a simple PDFViewCtrl with annotation functionality. Detailed tutorial can be found here.