Opening a PDF file in Windows Phone

前端 未结 3 931
礼貌的吻别
礼貌的吻别 2021-01-14 09:56

I\'m developing an app for Windows Phone 7 and I\'m using a Phonegap template for it. Everything looks perfect, but now I’m stuck trying to open a PDF file in the browser. I

3条回答
  •  失恋的感觉
    2021-01-14 10:24

    try this

    var installedLocation = Windows.ApplicationModel.Package.Current.InstalledLocation;
    var assets = await installedLocation.GetFolderAsync("Assets");
    var pdf = await assets.GetFileAsync("metro.pdf");
    Windows.System.Launcher.LaunchFileAsync(pdf);
    

    This worked correctly on my Device.

提交回复
热议问题