Display PDF files in Android
Is there a way to display PDF files in Android? I have tried the examples using a webview, but only get a blank page. It seems PDF files are not supported by default?
Can I download and bundle some kind of framework with my application that will handle the display of PDFs?
7 Answers
-
Accepted Answer
You can view PDFs in Android by utilizing Android Intents. This blog post shows you exactly how to do this with Titanium: http://developer.appcelerator.com/blog/2011/09/sharing-project-assets-with-android-intents.html
-
you can open it using third parity
[Google viewer]
(http://docs.google.com/viewer?pli=1)
and then put the generated link in openurl -
I created a Titanium module(in Java) that converts a pdf file into images (page by page), and saves it in the SDcard. Then created a reader layout using a Webview with next and previous buttons on top, to display these images page by page.
-
You'll need to integrate a native library. We are working to integrate PDFRender SDK with Appcelerator.
I'll update you when ready. -
if you need to open/view PDF file in your own app go to the marketplace Android PDF Reader. The demo is available to see how does it look like
-
Well, hopefully Mike Hopkins found an answer already, but in case he didn't…
If the user has a PDF reader, you can open PDFs using
Ti.Platform.openURL()
like this:Titanium.Platform.openURL('http://foo.com/bar.pdf');
This also works for PDFs you have downloaded to the user's phone.
-
You'll need to instruct your users to install a PDF reader. You can't bundle apps at this time.