bilal ahmed
bilal ahmed

Reputation: 31

Open PDF file from folder inside project in Windows Store App C#

I am working on Windows Store App. I have a folder named PDF in my solution in which I have one PDF file named "sample.pdf". I want to open that PDF file using code inside my application. I have seen many links but could not find anything useful

Help?

Upvotes: 1

Views: 545

Answers (1)

Jon
Jon

Reputation: 2891

You need to let the system open the file in the default viewer using LaunchFileAsync.

               StorageFile file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(@"PDF\file.pdf");
               Windows.System.Launcher.LaunchFileAsync(file);

Upvotes: 1

Related Questions