Launch PDF Windows Phone 7.1 without Component One

70 views Asked by At

I have PDF file in my assets folder in Windows Phone 7.1. I want to open that pdf file. Uptil now i have found many examples but all are using component one controls. I dont want to use component one. I know I can't open pdf with in my application using native libraries. Is there any way to open PDF from assets in web browser or I can launch Installed PDF reader application?

Any Idea?

1

There are 1 answers

0
Christian Amado On

Windows Phone 8:

You can write the following code in order to open PDF files (you need a PDF reader app):

private async void Button1_Click(object sender, RoutedEventArgs rea)
 {
    // Access your file. In this case, your local folder
    StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;

    // Access the PDF file
    StorageFile file = await local.GetFileAsync("YOUR_FILENAME.pdf");

    // Launch the query.
    Windows.System.Launcher.LaunchFileAsync(file);
}

Windows Phone 7:

There is no way to do without third party library like ComponentOne or Telerik.