I'm working on an app that will need to open a pdf inside the app itself. Is this even an option or does the user have to view the pdf in a different app altogether?
This is open source for open pdf file in app, maybe you can try it
android-pdfviewer
Related
when I open PDF file using XODO Pdf Reader from my Android app (written in Ionic framework), it opens within the app.
If I use another PDF app, it opens outside of the app.
Is it possible to somehow configure XODO and/or change the app so that the PDF opens outside of the app with XODO?
What I have:
What I want: (but with XODO)
Thank you :)
This is related to Activity launch mode: https://developer.android.com/guide/components/activities/tasks-and-back-stack#ManifestForTasks, in particular here Xodo is using "singleTop" so this is the expected behaviour. You can provide your feedback to the Xodo team at support#xodo.com.
I need to save PDF file when my app installs and then open it when a user clicks on a button. I found many solutions but was not able to integrate them into one.
Try this code, display pdf file from a file location (works from any file location, not SDcard specific)
How to open a PDF via Intent from SD card
I was doing this in work today and it is not that easy.
1) saving the file is not difficult any normal file code will work for a pdf file.
2) showing the pdf you have two options you can display a pdf in a webview if the device has internet access by displaying a Webview and loading google docs with you pdf file at the end of the url
3) or you can create an intent and see if the device has an application that will display the file, you will need to use a FileProvider to get it to run but there is a good post
https://developer.android.com/reference/android/support/v4/content/FileProvider.html
what the problem i am facing is in android mobile when you have only one app for viewing PDF document, in that case when you select a pdf file it opens directly the existing app for viewing without asking any permission but when you have more than one app for viewing PDF file and when you select a file it will ask your permission to open which app for viewing. Well, what i need is it should ask permission even when i have only one app for viewing pdf file.
Can it be done in android device?
If you wrote the PDF viewer app you could have it read the intent data for a file location on the phone to open the pdf file.
From the app that clicks the pdf file, you can start an intent and pass the file location with it after a pdf is clicked.
I was wondering how to open an android APP from a PDF. I wanted to make a PDF document for kids that would automatically open the application when the child pressed on the apps button on the PDF document. I can generate links in the PDf that will make it open videos and go to web pages, but not that could open an application already installed on the tablet.
I am downloading PDF file in my application and want to allow user to view it. Is it possible that using webview I can display that pdf file downloaded to SD Card or local memory.
As I know there is workaround in which I can provide the link of pdf file to google url which will open pdf in webview. But it lags and is very slow.
Basic answer, no. You can't open a PDF in a webview; so you either need to fire an Intent to open the file (the file can then open in the default installed app on the device); or write your own PDF reader.
Try to use pdf.js.
See http://www.worldwidewhat.net/2011/08/render-pdf-files-with-html5/
I downloaded its source and placed it in sdcard.
Then I use a WebView to load its index.htm.
It did show pdf file on a webView in sdcard in Android 4.0 device but sometime it show white page. I need to reload it and it finally can show.
Unfortunately, I also tested on Android 2.2 and 2.3 devices. They just show white page, nothing.
I know it make use of html5 canvas technology. I have checked on loading http://html5test.com/ on WebView and have tick on canvas element but still can't show pdf. Strange behaviour. Maybe really depends on Android version.