Getting started with XFINIUM.PDF Viewer in Android applications

This tutorial will show how to get started with XFINIUM.PDF Viewer in Xamarin.Android applications.

1. Create a new Android application.

Getting started with XFINIUM.PDF viewer in Android applications

2. Add references to xfinium.pdf.xamarin.android.dll, xfinium.pdf.render.xamarin.android.dll, xfinium.pdf.view.xamarin.android.dll, xfinium.graphics.xamarin.android.skia.dll and skiasharp.dll in your project. Alternatively, for SkiaSharp.dll, you can also add a reference to SkiaSharp nuget package version 1.58.1.0.

Getting started with XFINIUM.PDF viewer in Android applications

3. Open your activity’s axml file.

Getting started with XFINIUM.PDF viewer in Android applications

4. Inside the layout code add this part:

Getting started with XFINIUM.PDF viewer in Android applications

The ‘xfinium.pdf.view.PdfCoreView‘ tag is case sensitive.

5. Add a test PDF file to your project and set its build action to EmbeddedResource.

Getting started with XFINIUM.PDF viewer in Android applications

6. In your activity’s OnCreate method create a PdfVisualDocument object, set the pdfView.Document property with the PdfVisualDocument object and load a file in the document.

Getting started with XFINIUM.PDF viewer in Android applications

7. Run the application.

Getting started with XFINIUM.PDF viewer in Android applications

Leave a Reply