简体   繁体   中英

Launch PDF Windows Phone 7.1 without Component One

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM