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
close icon

Unable to get PDFViewer to work

I downloaded your sample for the PDFViewer and it works 

Then i cerated a new PCL project in Visual Studio 2017

I added the PDFViewer package to the portable project and also added it to the Android project

I then added the sample PDF file to the Assets folder in the portable project and marked it as embedded resource

I then added the PDF control per your documentation and added code to load it in OnAppearing as per your documentation

it looks like the stream is loading correctly but the PDF control is not loading the PDF file properly

attached is the project that does not work



3 Replies

SS Sathish Sivakumar Syncfusion Team May 8, 2017 12:57 PM UTC

Hi Michael, 
Thank you for using Syncfusion products. 
We are unable to reproduce the issue “PDF documents cannot be loaded properly in SfPdfViewer in Xamarin.Forms.Android” from our side. We have created a simple PCL project using Visual Studio 2017 with the details provided in your last update to load the PDF document in SfPdfViewer and it will be available in the below link: 
Kindly provide  the following details to investigate further: 
1.       PDF document you are used to load in SfPdfViewer 
2.       Simple sample or modify the above sample to reproduce the issue. 
3.       .NET Framework version 
4.       Essential Studio version 
5.       Android device and API details 

MS Michael Salzlechner May 8, 2017 02:50 PM UTC

the sample was attached to the post but you can get the full visual studio workspace from here

The above workspace was created with Visual Studio 2017 as follows

New Project
select Cross Platform App (Xamarin Forms)
select PCL 

Add PDFViewer nuget package to Portable and Android project

Add PDF file and mark as embedded resource
Add code to load PDF file

SS Sathish Sivakumar Syncfusion Team May 9, 2017 09:22 AM UTC

Hi Michael, 
Thank you for your update. 
On analyzing your sample we found that the native Xamarin.Android SfPdfViewer nuget package (Syncfusion.Xamarin.SfPdfViewer.Android) were referred in your Xamarin Forms Android (PdfViewer2.Android) PCL project. We would request you to kindly uninstall that nuget package and install the appropriate nuget package (Syncfusion.Xamarin.SfPdfViewer) as highlighted in the below screenshot to display PDF document correctly in SfPdfViewer in Xamarin.Forms.Android. 
Kindly revert us if you still facing the same problem. 

Live Chat Icon For mobile
Up arrow icon