Open PDF file from WinJS application

I have an application in which the user presses a button and the PDF file that is stored in the application must be presented.

They can view the PDF inside the application or run their own windows viewer, which is fine anyway.

How can I provide a link / event handler for clicking a button to launch a PDF file view?

+5
source share
1 answer

Use the LaunchFileAsync function of the Launcher class,

description: launches the default application associated with the specified file using the specified parameters.

code example:

Windows.System.Launcher.launchFileAsync(file, options).done( /* Your success and error handlers */ );
+5
source

All Articles