By default, PdfViewer uses native Android PDF rendering. But, it also provides options in both Xamarin.Forms Android and Xamarin.Android platforms to use Pdfium that is a third party open source PDF rendering engine. Pdfium is the solution for overcoming defects in native Android 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 for your convenience and is available with the demo sample attached at the bottom of this article.
The Pdfium binding project can also be created from scratch by following the steps below.
Using the 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 and ICustomPdfRendererService interfaces defined in the Syncfusion.SfPdfViewer.XForms.Droid and Syncfusion.SfPdfViewer.XForms namespaces respectively.
The entire CustomPdfRenderer class is given as follows.
The CustomPdfRenderer property should be assigned to the AlternatePdfRenderer property of the CustomPdfRenderer class.
This page will automatically be redirected to the sign-in page in 10 seconds.