How to Launch a PDF from a UWP (Universal Windows Platform) Web Application

后端 未结 3 1261
小蘑菇
小蘑菇 2020-12-21 14:15

I\'ve converted an existing web application (HTML5, JS, CSS, etc.) into a Windows UWP app so that (hopefully) I can distribute it via the Windows Store to Surface Hubs so it

3条回答
  •  情话喂你
    2020-12-21 14:54

    LaunchFileAsync is the right API to use here. You can't launch a file directly from the install directory because it is protected. You need to copy it first to a location that is accessible for the other app (e.g. your PDF viewer). Use StorageFile.CopyAsync to make a copy in the desired location.

    Official SDK sample: https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/AssociationLaunching

提交回复
热议问题