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.
Unfortunately, activation email could not send to your email. Please try again.

How to display PDF document from URL using SfPdfViewer in Xamarin.Android?

How to display PDF document from URL using SfPdfViewer in Xamarin.Android?

At present SfPdfViewer in Xamarin.Android do not have a direct support to display the PDF document from URL. However, as a workaround you can download the document or files from URL as Stream using WebClient class and load it in the PDF viewer.

The below code snippet illustrates how to download the PDF document from URL as Stream using WebClient:

C#:

 

Then we can load the downloaded PDF document Stream to display it in PDF viewer in Xamarin.Android. Please find the code snippet below for your reference:

C#:

 

We have also attached the sample of this complete illustrations here

Article ID: Published Date: Last Revised Date: Platform: Control:
7990 09/15/2017 09/15/2017 Xamarin.Android SfPdfViewer
Did you find this information helpful?
Comments
Balakrishnan Jun 12, 2018

It is not loading all the pages of the PDF file, It loads only one or two pages only. Is there any solution for that.

Reply
Balakrishnan Jun 12, 2018

I have tested with Xamarin forms project it is not working, I tested with Xamarin android project it is working fine.

Add Comment
You must log in to leave a comment

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.