Following scenario:
I am using the InAppBrowser plugin from Ionic Native and I am navigating to a local html.. I open the first html in the InAppBrowser with the code:
this.inappbrowser.create("files/index.htm");
The index.htm contains links to some pdf documents. Its a known issue that the InAppBrowser can't display/open a pdf file on an Android device. How can I tell the InAppBrowser to open documents with the Document Viewer from Ionic Native or something else that can display it? Or is there a way to subscribe to an event and catch the url if I click on an link to a pdf?
Thanks!
You can't directly open PDF in external App. You can try this solution.
Related
I am trying to build an app using Flutter that uses the Webview to open a website. Within this website there are a number of pdfs and I want to open them inside the app as well, instead of redirecting to a browser or an acrobat viewer. Is there any way to do this?
I cannot seem to embed a local page "page2.hyml as an Iframe in my Cordova "index.html" page.
I am successfully able to embed an external URL as an Iframe though.
Is there a way to do that?
I am developing an Android application using Cordova where I am required to display a PDF file in application.
I have tried using pdf.js from Mozilla and it worked only on browser and not in application. Same was the case with <embed></embed>.
I am not able to find any solution, please help me to solve this issue.
Thank you.
You cant Open PDF in cordova webview. Try Phonegap File Opener Plugin.
I am developing an web+cross platform app using Jquery Mobile+PhoneGap+Android. In web app, I am able to open pdf file links within my app page using iframe. But, in Phonegap generated Android build, iframe is unable to render pdf content,it is showing that iframe area as empty.How can I display the pdf file/content, whose src I know at runtime, within android webview. Thanks In Advance.
I've just published my plugin, which can open almost any type of file, which is stored locally on Android device.
Please take a look at: https://github.com/markeeftb/FileOpener
Plugin opens external application which handles the preview of the document.
I have the childbrowser plugin installed and working on my Phonegap application. Works fine for websites but I want to instead view PDFs which have been stored in my assets file.
The link I have to the pdf is currently
Test
But when I do this it trys to navigate to
http://file://android_asset/pdf/Starting-Out_master.pdf
How can I change the link to view the prepackaged PDFs?
You cannot open a PDF using the ChildBrowser. You will need to use the PDF Viewer plugin. Here is a link, sorry that it is in Italian you'll have to use Google Translate or something similar.
http://www.giovesoft.com/2011/08/download-and-open-pdf-with-phonegap.html
Using the WebIntent plugin may also work. Most (but not all) Android phones come with a PDF viewer built-in, so letting the Android OS decide what application installed on the phone to handle the PDF file should work in most cases.
You could get the pdf file URI and open it with the childBrowser plugin's openExternal and let the native browser handle the PDF.