0
votes

I have come to the stage in my app where I need to download a pdf file from a certain URL, save it to disk (on the phone that is), and then as soon as it's saved try and open the document in whatever application is installed on the phone to handle PDFs (Adobe reader).

I have a rather limited understanding of how to save to disk and launch a certain file with another application.

Can someone point me in the right direction or give me some tips on how to accomplish this? My understanding of windows phone is quite limited and I need to quickly add this feature on the app.

3

3 Answers

3
votes

In Windows Phone 7, it is not possible to programmatically start the PDF viewer (it's possible in Windows Phone 8 though). So the best I can suggest is using the WebBrowserTask to open the web browser directly at the PDF's URL, then let the user open the file.

It's definitely not a great user experience, but I've been unable to find any other way (even using a WebBrowser control directly in the app doesn't seem to work).

var task = new WebBrowserTask();
task.Uri = new Uri("http://www.education.gov.yk.ca/pdf/pdf-test.pdf");
task.Show();
0
votes

Where you saved the PDF in Isolated Storage? You directly opened the Online PDF file in WebBrowser.

0
votes

Follow these steps:

1) Download the from URI 2) Save to the Isolation Storage 3) Launch it using the launcher.

Note: 1) If you are downloading the pdf file than use .pdf extension while storing in Isolation Storage. 2)Make sure you have the related software installed in your phone like Adobe for PDF etc.