Create Tools package from PDFViewCtrlTools Java source code

This tutorial only applies to Xamarin.Android.

Why do I want to build Tools package from source?

PDFViewCtrlTools project for Android is an open source java project. Although a number of UI controls and tools are provided out-of-the-box, there may be behavior that you would want to change to best suit your own project. The best way to do so will be diving into the source code.

Before you get started, it is a good idea to first have some basic knowledge on the topic. Xamarin provides a comprehensive guide on Binding a Java Library and we recommend you to briefly go through it. Please note that you will not need to create a binding project as it is already provided in the package.

Apryse Android SDK for Xamarin is a completely open source binding project. By the end of this tutorial, you will be able to create PDFTron.Android.Tools NuGet package from source.

Latest Visual Studio is required to proceed.

Windows machine: Due to character limit on Windows machine, it is recommended that you unzip the packages with short root path. For example, D:\MyFolder will be a good path but D:\MyFolder\PDFTronXamarinAndroid\MyLongLongLongLongLongLongLongLongPath will be a bad path.

  1. Download the Apryse for Xamarin.Android SDK package, refer to as PDFNetXamarin.Android package below
  2. Download the Apryse for Android SDK package, refer to as PDFNetAndroid package below
  3. In PDFNetAndroid package, update the /lib/src/PDFViewCtrlTools project in Android Studio as you wish
  4. Once you are done with changing the source code in Java, create PDFViewCtrlTools-release.aar by either clean build from Android Studio or command line via gradle clean build, the output can be found in /PDFViewCtrlTools/build/outputs/aar folder
  5. Rename PDFViewCtrlTools-release.aar from previous step to tools.aar and copy it to PDFNetXamarin.Android/lib/android/Native folder
  6. Copy either of full/pdftron.aar or standard/pdftron.aar from PDFNetAndroid/lib folder to PDFNetXamarin.Android/lib/android/Native folder, your PDFNetXamarin.Android/lib/android/Native folder should now look like this:

Apryse Docs Image
  1. From PDFNetXamarin.Android package, open /projectSrc/PDFNetAndroidXamarin/PDFNetAndroidXamarin.sln in Visual Studio, make sure you see it gets all the NuGet Packages
  2. Make sure there is no missing files when you expand the folders in Visual Studio

Apryse Docs Image
  1. Clean the project
  2. Build PDFViewCtrlTools project
  3. You can find the output PDFTron.Android.Tools.nupkg in PDFNetXamarin.Android/lib/android folder

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales