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

Does pdf viewer load document based online i.e. from url instead of Streaming?

Does pdf viewer load document based online i.e. from url instead of Streaming? It will be far better to read file from url as well. Thank you.

3 Replies

SS Sathish Sivakumar Syncfusion Team September 5, 2017 10:46 AM UTC

Hi Ishwor, 

Thank you for using Syncfusion products 

At present we do not have support to load the PDF document straight away from URL in SfPdfViewer in Xamarin. However, As a work around we can achieve it by downloading the PDF document from URL as Stream using WebClient and load the downloaded stream into SfPdfViewer to display appropriate PDF document in Xamarin.Android application.  

Please find the code snippet below to download the PDF document from URL as a Stream using WebClient. 

Code Snippet: 

private Stream DownloadPdfStream(string URL) 
{ 
//Initialize WebClient 
WebClient webClient = new WebClient(); 
 
// Initialize Uri 
var uri = new System.Uri(URL); 
//Returns the PDF document stream from the given URL 
return webClient.OpenRead(uri); 
 
} 


We have also attached the sample in the below link for your reference. 


Please let us know if you need any other assistance. 

Regards, 
Sathish 



IK Ishwor Khanal September 11, 2017 02:04 PM UTC

Thank you for your response. I wonder how big the file it can load because when I tried to load a pdf file having 100 pages it shows nothing and app becomes ANR.



SS Sathish Sivakumar Syncfusion Team September 12, 2017 09:47 AM UTC

Hi Ishwor, 

We are unable to reproduce “Application not responding when we download and load the large PDF document into SfPdfViewer in Xamarin.Android” in our side. We tried to reproduce the issue by downloading the PDF document from the below URL and load it into SfPdfViewer. 


We have also attached the video which we captured while trying to reproduce the reported issue and it is available in the below link: 


We would request you to kindly create a new support incident using the link here and share the following details to investigate further on your issue: 

  1. URL link which you tried to download the PDF document and load the same in SfPdfViewer
  2. Simple sample or modify the sample which we shared in our previous update to reproduce the reported issue.
  3. Android device configuration and its version
  4. Replication procedure to reproduce the reported issue.

Regards, 
Sathish 


Loader.
Up arrow icon