4
votes

I have to make an application that should capable of reading PDF documents on Android device. Actually I do not want my app to be dependent on other apps to read the PDF file.

I had gone through the questions that are asked here and at some other places also. They all directly or indirectly using third party app.

Is there any API or something similar is available through which I can implement reading of PDF files directly in my app? How about converting the PDF document to PNG image? But the PDF-PNG method wont let users select the texts.

Any suggestions?

Thanks

2
First, development question should be asked on StackOverflow. Second, why do you have such artificial requirement? In Android, you typically launch an Intent so a program can offload another program's capabilities, and to allow the user to read PDF using their preferred readers. The API you're looking for is the Intent API to launch the user's preferred PDF reader. - Lie Ryan

2 Answers

5
votes

There exists an library from Adobe that you can use. Its based on the NDK and you need to do the wrapping all by yourself. Its also extremely expensive, basically nothing for a small firm/single developer but for bigger companies. Afaik the license is not only expensive but also annual based, so you need to pay for it in every year...

There are other libraries, basically open source. Some of them have good performance but a lack of functionality (most of them based on NDK, too). I found only one pure "java" library but the performance was more than worse (loading time 10sec for a page and more).

There are three possibilities you should consider:

  1. Using an external application, so you just need to implement the library of your PDF documents
  2. You write everything by yourself including a pdf reader part
  3. You create a middle "tier" where you convert your PDF into PNGs or JPG (I prefer PNG for better quality). The much better performance comes with a lack of features.

I'm currently developing a complex application like mentioned in 3. but I can't go into details, sorry.

1
votes

I would definitely recommend the Qoppa stuff on Android.