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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Load PDF from device storage

Thread ID:

Created:

Updated:

Platform:

Replies:

130493 May 16,2017 02:50 AM UTC May 18,2017 05:04 PM UTC Xamarin.Forms 3
loading
Tags: PdfViewer
SweetNerdyGirl
Asked On May 16, 2017 02:50 AM UTC

Hi,

I implemented pdfviewer to xamarin forms and it is working well. I just want to ask on how or what is the proper way of loading a pdf document from device storage. I can't get my code work. This is my sample code snippet:

 protected override void OnAppearing()
        {
            base.OnAppearing();
            var root = Android.OS.Environment.ExternalStorageDirectory.AbsolutePath;
            var path = Path.Combine(root.ToString(), "Sample.pdf");
                  
            //Loads the PDF document as Stream to PDF viewer control
            pdfViewerControl.LoadDocument(path);
        }   

Thanks.

Balasubramanian Sundararajan [Syncfusion]
Replied On May 16, 2017 09:20 AM UTC

Hi Krystille, 
 
Thank you for using Syncfusion product. 
 
We can load PDF documents in predetermined folders such as Document library, Pictures library, Local folder in which the application is deployed. We have prepared a sample to demonstrate loading PDF documents from such folders in SfPdfViewer control. Please find the sample in the link below.  
  
   
Please try the above sample and let us know whether it fulfils your requirement. 
 
Thanks, 
Balasubramanian S 


SweetNerdyGirl
Replied On May 17, 2017 12:53 AM UTC

You're sample works. Thanks. But I tried using xamarin form shared project, it is not working though.

Navaneetha Kannan Sudalai Muthu [Syncfusion]
Replied On May 18, 2017 05:04 PM UTC

Hi Krystille, 
 
We are not able to reproduce the issue “PDF document is not loaded to PdfViewer in Xamarin.Forms shared project”. We have attached a simple sample below, with which we have tried to reproduce the issue.  
 
 
 
 
Before running this sample kindly place a PDF file in the respective folders from which the file is loaded in each platform.  
Please modify this sample or provide us with a simple sample and the PDF with which the issue can be reproduced. It will help us analyze more on the issue and help you better.  
 
Best, 
Navaneetha Kannan 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

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

;