Some test text!

menu
search
Xamarin.Formskeyboard_arrow_down

Get started with Xamarin.Forms

Welcome to PDFTron. This guide will show you how to get started with integrating a free trial of the PDFTron SDK into your Xamarin.Forms application. We will clone the Xamarin.Forms sample repository, walk through the project structure, and show you how to customize the PDFTron components of your Xamarin.Forms app. Your free trial includes unlimited trial usage and support from solution engineers.

linkPrerequisites

  • Latest version of Visual Studio

linkInitial setup

  1. Clone the Xamarin.Forms sample by executing
git clone https://github.com/PDFTron/xamarin-forms-sample.git
  1. Open CustomRenderer.sln in Visual Studio.

You are now ready to run the sample. If you want to run the UWP sample as well, follow the steps below:

linkOptional, for UWP only

  1. Download and extract the UWP project.
  2. Run the PDFNetUWPApps.vsix from /PDFNetUWPApps/Lib to install PDFNet SDK for UWP.
  3. From the UWP download package, copy the /Samples/PDFViewCtrlTools_VS2015 folder to the Xamarin.Forms sample folder ContentPage.
  4. Find the existing PDFNet SDK for UWP reference in the CustomRenderer.UWP sample and delete it. Delete existing
  5. Right click the CustomRenderer.UWP project and add a reference to the PDFNet SDK for UWP extension that was installed from the download package. Add ReferenceSelect PDFTron for UWP

linkSample overview

After initial setup, your xamarin-forms-sample/ContentPage folder should look like this(assuming you followed UWP integration steps):

xamarin-forms-sample
├── ContentPage
│   ├── CustomRenderer
│   ├── Droid
│   ├── iOS
│   ├── packages
│   ├── PDFViewCtrlTools_VS2015
│   ├── UWP
│   └── CustomRenderer.sln
└── ...

Notable files and directories include:

File/Folder NameDescription
CustomRendererContains the declaration for the shared Xamarin.Forms page
DroidContains custom renderer for Xamarin.Android
iOSContains custom renderer for Xamarin.iOS
packagesContains the dependencies for the project
PDFViewCtrlTools_VS2015Annotation and UI tools project for UWP sample that was imported from PDFTron UWP SDK
UWPContains custom renderer for UWP
CustomRenderer.slnThe Visual Studio solution file for the entire sample

linkRun the sample

The process of running the sample is the same for all samples you want to run.

  1. Right click the solution CustomRenderer and click Restore NuGet Packages to install the project dependencies. Restore NuGet packages
  2. Build the solution by right clicking CustomRenderer and selecting Build Solution.
  3. Run the project sample of your choice. Regardless of which project you ran, you will see a selection screen pop up which asks you to run either the Basic Viewer or the Advanced Viewer.

For reference, this is how the Basic Viewer should look on all three platforms:

AndroidiOSUWP
androidiosuwp
For a more involved guide on how to integrate PDFTron SDK into a Xamarin.Forms project, check out this guide for the advanced viewer and this guide for the basic viewer.
You can view the source code for this project here.

Get the answers you need: Support

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.

PDFTron Receives USD$71 Million Growth Investment Led By Silversmith Capital Partners

Learn more
close