How to Display PDF File with in the same App in phonegap

前端 未结 3 1272
滥情空心
滥情空心 2020-12-30 09:24

how to show Pdf file with in the same phonegap app. i tried Inappbrowser,Mupdf,PDFJS all are displaying PDF using other pdf viewer.i would like to open the pdf file with in

3条回答
  •  一整个雨季
    2020-12-30 09:47

    (Excuse my poor English) I don't know what you mean "in the same app", because inappbrowser, Mupdf and pdf.js can all do that.

    In Android platform, most popular solution is send intent and open via other pdf viewers because users can choose there favorite(you can try File Opener 2). If you don't like that, you can build an Activity for displaying pdf in your app, just like MuPDF Viewer. If you want open pdf file in Cordova/Phonegap webview, you need mozilla's PDF.js, that's a pure-js lib for rendering pdf file on HTML5 canvas, but it pretty slower than using native solution (even you build with Crosswalk), so I dont suggest that.

    It's much easier in iOS platforms. iOS's UIWebView can open pdf files natively, so all you need is using inAppBrowser Plugin. If you want more features, there're many plugins (like Cordova PDFReader IOS) you can choose.

    Hope that helps with you.

提交回复
热议问题