How to open pdf file in Windows Phone 8?

后端 未结 3 1437
再見小時候
再見小時候 2020-12-01 20:09

I have some pdf files inside (the project files) my app and I wanted how to open in Adobe Reader or the other, but I don\'t know how.

In iOS is more easy and in And

3条回答
  •  悲哀的现实
    2020-12-01 20:31

    You have to use the LaunchFileAsync method of Launcher class. Example:

    // Access the file.
    StorageFile pdfFile = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync("file.pdf");
    
    // Launch the pdf file.
    Windows.System.Launcher.LaunchFileAsync(pdfFile);
    

    You will find more info here:

    Auto-launching apps using file and URI associations for Windows Phone 8

提交回复
热议问题