回答

0

通常我更喜歡使用默認的應用程序來打開PDF文件。如果你想創建一個像上下文菜單一樣的桌面,你必須創建CSS來做到這一點,並使用類似PDF.js的東西來創建一個PDF閱讀器。

編輯:要打開默認應用程序,您應該打開Internet Explorer並使用文件的本地URI。

您必須使用Launcher類的LaunchFileAsync方法。示例:

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

// Launch the pdf file. 
Windows.System.Launcher.LaunchFileAsync(pdfFile); 
+0

而您如何使用JavaScript在默認應用程序中打開數據? – tvelop

相關問題