4

I know this question has been asked several times but I couldnt find one satisfying answer.My requirement is simple.just to open the pdf docs within my app(android).But I am not able to find a simple way of doing this.either its native c/c++ way or writing your own engine.But isnt there any simple API so that I can include it like a jar and view the pdf?

Rradhak
  • 437
  • 1
  • 4
  • 16
  • 2
    possible duplicate of [PDF parsing library for Android?](http://stackoverflow.com/questions/4665957/pdf-parsing-library-for-android) – CommonsWare Oct 25 '11 at 18:50
  • Please see below StackOverflow link's answer for Read Pdf from sdcard. [Read PDF using PDFViewer](http://stackoverflow.com/questions/11152956/example-of-code-to-implement-a-pdf-reader/11153601#11153601) – Dipak Keshariya Aug 20 '12 at 11:10
  • Take a look [there](http://stackoverflow.com/questions/4665957/pdf-parsing-library-for-android/4766335#4766335). I think the most voted answer is really complete. You will find both open source, most of them GPL3, and commercial solutions that should satisfy your needs. – Ant Picci Aug 20 '12 at 11:01

2 Answers2

3

No. There is no API in the Android SDK to natively display PDF.

Solutions I can suggest:

-Use an external application:

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path, "application/pdf");
startActivity(intent);

-If your PDF document is accessible online, use the Google Docs Viewer to open your PDF in a WebView:

http://docs.google.com/viewer?url=http://mypdf.pdf
Tom Miette
  • 129
  • 3
  • I analysed the above two solutions as well.The problem is the device may or ay not have reader installed and also my pdf is in internal storage:(.I know this has been asked over and over,but commercial one is also fine for me.I tried some,which was reaally really slow. – Rradhak Oct 25 '11 at 20:33
1

you can use native plugin to show the PDF within your app. try this apv

KRP
  • 294
  • 7
  • 22
Aruna
  • 701
  • 10
  • 26