1

I am developing a windows store app using C#. In my app I need to open some PDF's and for that previously I was opening PDF with the system's default PDF opener. My code was working fine in windows 8.1 because client ask me to open these PDF's on Microsoft Reader app. And in windows 8.1 default PDF opener app is Microsoft Reader. But now on windows 10 PC default PDF opening app is Microsoft Edge. I want to change this behavior programmatically. I want my application to open these PDF's again in Microsoft Reader app. How can I forcefully open my PDF's into Reader app?

Any help would be really appreciated. Thanks in Advance!

Waqas Ahmed Khan
  • 343
  • 4
  • 21

1 Answers1

1

You can't enforce that the PDF be opened with a specific app (what if that other app wasn't installed?) but you can set a preference.
Like this:

// Set the recommended app
var options = new Windows.System.LauncherOptions();
options.PreferredApplicationPackageFamilyName = "Microsoft.Reader_8wekyb3d8bbwe";
options.PreferredApplicationDisplayName = "Reader";

// Launch the URI and pass in the recommended app 
var success = await Windows.System.Launcher.LaunchUriAsync(uriOfPdf, options);
Matt Lacey
  • 65,560
  • 11
  • 91
  • 143
  • I have already done this configuration...I want to open the app using Microsoft Reader app....every windows version has Microsoft Reader app.....so we don't need to worry about this.... – Waqas Ahmed Khan Nov 27 '15 at 15:55