We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to use Pdfium rendering engine with PdfViewer in Xamarin Android

Platform: Xamarin.Android |
Control: PdfViewer

By default, PdfViewer uses native Android PDF rendering to render the pages of the PDF document. It also provides options in both Xamarin.Forms Android and Xamarin.Android platforms to use Pdfium as an alternate, which is a third party open source PDF rendering engine. Using Pdfium rendering engine is the solution to overcome the defects in native Android PDF rendering.


Creating Pdfium binding library


To use Pdfium in your application, the Pdfium binding library is needed. A Pdfium binding library has already been created and it is available with the demo sample attached at the bottom of this article for your convenience.


The Pdfium binding project can also be created from the scratch using the steps below.


  1. Download the pdfium-android-1.7.0.aar android archive file from  https://mvnrepository.com/artifact/com.github.barteksc/pdfium-android/1.7.0


  1. To create the binding project from this archive file refer tohttps://developer.xamarin.com/guides/android/advanced_topics/binding-a-java-library/binding-an-aar/


  1. Install the Xamarin.Android.Support.Compat dependency package in the project.


  1. Compile the project to generate the Pdfium library.


Using Pdfium binding library in the application project


Refer to the binding library in your android project.

Add a new class named “CustomPdfRenderer” to the android application project. This class must implement the ICustomPdfRenderer interface defined in the Syncfusion.SfPdfViewer.Android namespace.


The entire CustomPdfRenderer class is given as follows.



Create an instance of the CustomPdfRenderer class and assign it to the CustomPdfRenderer property of the PdfViewer.




Sample link:


2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile