share
Stack OverflowPDF parsing library for Android?
[+53] [11] Nimbuz
[2011-01-12 06:31:40]
[ java android pdf ]
[ http://stackoverflow.com/questions/4665957/pdf-parsing-library-for-android ]

I'm looking for a fast PDF library, even commercial is okay.

Problem of opensource java PDF renderers that they are based on awt/swing which is not available on Android, so this need to be adopted to Android GUI model.

Best for now I found and checked: https://pdf-renderer.dev.java.net/ (not so old, not so huge, working on example PDFs).

Another is vuDroid PDF implementation, but its painfully slow so its out of option.

Thanks!

Similar question: stackoverflow.com/questions/3530780/… - Harry Joy
(1) Not similar I think, he needs a library for PDF manipulation. - Nimbuz
I am also looking for a PDF viewer/parser that is able to show PDFs in a view (not a separate activity) and perhaps support caching of PDFs so you can switch between them quickly. It also needs to be fairly quick in the initial loading of a PDF. - Austyn Mahoney
Did adobe not release a native pdf reader for android? I personally will steer away from any third party implementation. There could be a huge performance penalty (especially with rich pdf rendering). Let your application suggest adobe app installation. (utlizing DownloadManager.Request). - doc_180
Do you just want to display a PDF, or manipulate it? - Mark Storer
StackOverflow is littered with questions about converting PDF files to images on Android. The problem is that most of the renderers use java.awt.image.BufferedImage which is not supported on Android. Voting to reopen based on the accepted answer here being comprehensive. - Brian Roach
[+48] [2011-01-22 05:25:57] Vikas Patidar [ACCEPTED]

Here is the list of the other open sources PDF readers running on the top of the Android

Note that all of these are bound by the terms of GPL and may not be suitable for the commerical use [5].

The following is a list of SDKs suitable for commercial use:

[1] http://code.google.com/p/apv/
[2] http://code.google.com/p/apdfviewer/
[3] http://code.google.com/p/droidreader/
[4] http://code.google.com/p/android-pdf/
[5] http://www.palminfocenter.com/news/6679/palm-sued-over-pdf-technology-dispute/
[6] http://www.adobe.com/
[7] http://www.pdftron.com/pdfnet/mobile/android_pdf_library.html
[8] http://www.qoppa.com/android/pdfsdk/
[9] http://www.androidpdf.mobi

(5) Already tried these, all are awfully slow! - Nimbuz
@Nimbuz: personally I haven't used any one of these but as I have a list of them so I thought to suggest you. - Vikas Patidar
(3) Selecting your answer, just coz I have to, but I didn't find a decent solution and gave up - went for iOS/ - Nimbuz
Is there any ob above library can detect internal anchors and embedded hyperlinks of PDF...? - nisha.113a5
Maybe its some value to somebody. The PDFTron library comes in at 26MB. Too much for most apps I would guess. However this post aludes to them being able to trim it to 5MB, but that would be a custom build groups.google.com/forum/?fromgroups#!topic/pdfnet-sdk/… - jiduvah
MuPDF is also available for commercial licensing. - ccxvii
Android PDF Viewer (APV) is indeed very slow, but only really so after zooming. The bigger problem is that the picture goes black, and tiles appear one at a time until the canvas is ready. This is not a solution for a production app. - Paul Lammertsma
Perhaps the list might be revisited? We have year 2013 now. - Yar
@Yar: you are free to update. - Vikas Patidar
1
[+23] [2011-01-24 08:08:07] Labeeb P

Me also faced this like a problem. My condition is very specific. I need to display a some pdf file in my application which was downloaded from server. But after download my client need to read it really fast. They didn't allow even to poss a second for rendering. So what i did is

  • After downloading the i have converted each page into image to a particular folder
    I have converted each page to bitmap using library i got from Android PDF Viewer [1], then saved it as png file using Bitmap.compress function.
  • At the time of displaying i have displayed this image one by one with zoom effects.

My client is well satisfied with this. Hope some times this may help you.

[1] http://sourceforge.net/projects/andpdf/develop

can u provide the sample or api link for use "android PDF Viewer" - Krishna
this library does not render corectly - Nicolas Tyler
How did you extract bitmaps from a pdf file? On the pdf viewer page I see only .apk files, no library. Do you call it with some intent and it writes extracted bitmaps? - Yar
2
[+4] [2011-06-15 22:41:52] Lilou

IText is not a viewer so a port of Itext will not work for you.

Qoppa Software has just released a PDF library for Android (ported from Java) which supports viewing, annotating and manipulating PDF documents. According to reviews, the renderer is fast to open and to zoom into PDF documents.


3
[+3] [2011-02-01 19:45:17] Abid Ullah

I'm not sure if you're looking for a Java only solution, but Foxit provide an Embedded PDF SDK [1] for mobile devices written in C++. You could use this with the NDK which should give you the performance you need. Not sure how much it costs though.

[1] http://www.foxitsoftware.com/pdf/sdk/embedded/

4
[+3] [2011-05-10 17:02:18] Mark Storer

iText was recently ported to Android by the original author, Bruno Lowagie:

From the 5.1.0 release notes:

The most important jars are those with the binaries: itextpdf-5.1.0.jar and itext-xtra-5.1.0.jar. Note that we've split iText in two parts: the core library and extra functionality. In the future, we'll provide even more different modules. Why? Because we're also working on an Android version of iText. Currently, the Android version is trimmed down to an "iText light" version (no encryption, no parsing,...). We'd like to be able to offer iText as a combination of different modules in the future. For instance: if you don't need PDF 2 functionality, then you don't need to ship the itext-xtra.jar with your application. [If you want to know more about getting the Android version and using it in a commercial app, please contact our sales department [1]]

It's not a full port (yet... crypto, no parser package for content parsing), but is available, and your dollars will no doubt help to direct which features might be added next.

PS: Others have taken it on themselves to port iText to Android for their own use... this generally involved ripping out everything they weren't using and porting the rest: one-offs, not suitable for general use.

[1] http://itextpdf.com/terms-of-use/

5
[+3] [2011-09-03 17:10:31] handaru

Android PDF Viewer (APV) 3.0 [1] is very fast. Faster then Official Adobe Reader for Android. I use Nexus S.

[1] http://code.google.com/p/apv/downloads/detail?name=apv-0.3.1dev5.tar.gz&can=2&q=

Android PDF Viewer (APV) is snappy with panning, but is very slow with zooming. The bigger problem is really that the picture goes black, and tiles appear one at a time until the canvas is ready. This is not a viable solution for a production app. - Paul Lammertsma
6
[+2] [2011-01-22 21:29:29] Kurt Pfeifle

MuPDF [1] by the fine folks of Artifex (the company which pays the Ghostscript developers).

Written in C. Simple, fast, lightweight PDF renderer specifically designed to also run on mobile devices. Core rendering engine inside the better known Windows PDF viewer SumatraPDF [2]. {And SumatraPDF IS fast (on Windows). It's current development version (which I compiled myself) just recently gained a few features which will make me finally drop Foxit, Adobereader and Primo/NitroPDF on my WinXP-Netbook.}

[1] http://mupdf.com/
[2] http://blog.kowalczyk.info/software/sumatrapdf/free-pdf-reader.html

I can really recommend this one! Renders beautifully and quite fast! - Sander Versluys
7
[+2] [2011-01-24 02:59:50] Nicolas Raoul

I have read the source code of some open source Android PDF viewers:
They have a Java UI, which calls the mupdf [1] C library via JNI like this [2].

[1] http://mupdf.com/
[2] https://code.google.com/p/droidreader/source/browse/trunk/src/de/hilses/droidreader/PdfRender.java

stackoverflow.com/questions/12507108/… cau u give me reply for this one - kyogs
8
[+2] [2012-02-18 15:29:14] handaru

I use and love PDFViewer SDK from Radaee which is sold and supported here: http://www.androidpdf.mobi. Fast and customizable.


(2) It seems to me that Radaee uses Poppler (GPL!) library, in violation of the GPL. The symbols in their library look suspiciously similar to the symbols in Poppler... - winitzki
9
[+1] [2011-01-20 18:58:43] Karthik Ramachandran

You might want to try www.slgmobile.com they have native android rendering software. Not sure if they license the render.


stackoverflow.com/questions/12507108/… how can i implement ? - kyogs
10
[0] [2011-01-22 00:06:07] the100rabh

You could try this one http://andpdf.sourceforge.net/ or http://code.google.com/p/nookdevs/downloads/detail?name=apdfViewer.apk&can=2&q= [1]

[1] http://code.google.com/p/nookdevs/downloads/detail?name=apdfViewer.apk&can=2&q=

Slow as hell - all open source libraries. - Nimbuz
which phone did u try that on ?? - the100rabh
11