Opening a PDF file in Windows Phone

前端 未结 3 928
礼貌的吻别
礼貌的吻别 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:06

    Toni is correct. You could go and try to build your own viewer (which would be the same thing as using C1, but with more time involved). I worked on a port of iTextSharp and PDFSharp for WP7, but neither of which are PDF Viewers. They are good for creating PDFs and parsing them some (but to render them there is more work involved). This has been a personal quest of mine, but honestly the best I have gotten is to be able to extract some images from the PDF (and none of the text)

    0 讨论(0)
  • 2021-01-14 10:21

    You cannot open pdf files from the isolated storage in the default reader for PDF files. If the file is online e.g. it has a URI for it, you can use WebBrowserTask to open it since that will download and open the file in Adobe Reader.

    On Windows Phone 8 you actually can open your own file in default file reader for that extension, but I am not sure how that will help you since you target PhoneGap and Windows Phone 7.

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题