52

I need a PDF library for manipulating a PDF documents, (creating PDF, image convertinng to PDF) and things like that but in Android.

I tried the android itext port but the library project generates compile errors after I added it to my Project. Looks like it is still using some affinetransformation classes that are defined in AWT.

Kurt Pfeifle
  • 86,724
  • 23
  • 248
  • 345
Nezir
  • 6,727
  • 12
  • 54
  • 78
  • Ok , MvanGeest I am a completely new here :) I try it with iText & on forums some people say it should work and some it does't , I was imported him in my project and fallow tutorial how to use it and nothing happened .. try it few time result nothing .there is no error but in a place where I want to create a PDF there is nothing . – Nezir Aug 20 '10 at 12:34
  • I used iText too. You can see my code at http://stackoverflow.com/questions/3530780/android-is-there-any-free-pdf-library-for-android. – SidJ Aug 15 '11 at 16:31
  • 1
    Sridhar, check your link. It navigates to this page. – Nguyen Minh Binh Jul 13 '13 at 13:33
  • See https://github.com/barteksc/AndroidPdfViewer and https://android-arsenal.com/tag/72?sort=created&category=1. – CoolMind Dec 12 '19 at 09:58

4 Answers4

17

It seems that no one of the pure java pdf libraries will work with android because they use libraries that aren't supported by android. I think I read that iText is interested in doing a port to android but thinks that google should support them if they did, haven't got a source on that though.

Here is a project in work for writing pdfs in android: sourceforge.net/projects/apwlibrary Haven't tried it and it says that it only does simple pdfs

softarn
  • 5,327
  • 3
  • 40
  • 54
  • softran I was on this link before and this is like starting a new project but there is no any file download.It was just link redirecting from : http://sourceforge.net/projects/apwlibrary/ to http://coderesearchlabs.com/androidpdfwriter/ – Nezir Aug 20 '10 at 12:56
  • 2
    Why is it still accepted? Is it still valid? We have 2013 now! ;) – Yar Feb 26 '13 at 13:25
  • Library still valid as of today. – Pang Jun 30 '13 at 08:30
  • I agree with APW Library, a truly Android PDF Lib, But the problem is it is in a very early version, i am still writing routines to suit my needs according to the following sources : [Adobe PSD Format](http://www.adobe.com/content/dam/Adobe/en/technology/pdfs/PDF_Day_A_Look_Inside.pdf) , [GNU PDF](http://www.gnupdf.org/Category:PDF), [Adobe Supplement ISO 32000](http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/adobe_supplement_iso32000_1.pdf), and a whole lot of other resources found at google. – Sri Krishna Mar 25 '14 at 04:26
6

This might help you

http://androiddeveloperspot.blogspot.com/2013/05/android-pdf-reader-open-source-code.html

PDF Library to rendering the PDF files in Android

You can also try pdfbox

http://pdfbox.apache.org/

You can chk this post

http://markmail.org/message/b2xjozidt32rhuyq#query:pdfbox%20android+page:1+mid:ipq7pviignd4cpja+state:results

Community
  • 1
  • 1
DeRagan
  • 22,827
  • 6
  • 41
  • 50
  • PDFBOx is not gonna work with Android. – Mike Bevz Jul 23 '13 at 18:31
  • Though I have not tested,but these `StackOverflow` answers state that due to `AWT`, `pdfbox` can't be used on `Android`. http://stackoverflow.com/questions/9696157/pdfbox-for-processing-pdf-in-android – laaptu Feb 03 '14 at 09:43
  • 1
    There's now a PDFBox port for Android: https://github.com/Birdbrain2/PdfBox-Android – Theo Jul 13 '15 at 12:22
3

Have a look at MuPDF.

MuPDF uses a very small footprint and has nearly-complete support for all features of PDF-1.7. It is the base for the quite popular (Windows) SumatraPDF viewer, but it has been ported to Android and iOS too.

Then also have a look at all the questions that have been asked on this website concerning MuPDF.

Community
  • 1
  • 1
Kurt Pfeifle
  • 86,724
  • 23
  • 248
  • 345
  • 9
    take note that is not free for commercial apps – Buda Florin Dec 14 '12 at 12:11
  • @BudaFlorin: maybe you look up the fine differences between "free as in beer" and "free as in liberty" for once? Also the fine differences between "commercial" applications and "proprietary" applications or software? A software can well be commercial (see RedHat) without being closed source or proprietary, and a "free" (as in beer) one can still be closed source (see many shareware programms, or many Android apps). – Kurt Pfeifle Dec 16 '12 at 01:21
  • 1
    @BudaFlorin: If your comment did read *'Take note that MuPDF is not free for closed source apps'* it would be more appropriate and exact... – Kurt Pfeifle Dec 16 '12 at 01:22
  • :) Yes, you're right :) is not free for commercial apps which are't open source – Buda Florin Dec 17 '12 at 16:06
  • 4
    @BudaFlorin: it's also not free (gratis) for non-commercial apps which aren't open source. – Kurt Pfeifle Dec 17 '12 at 17:01
1

IText seems to work fine.

To fix the affineTransform compilation issue you simply need to mark the "Micro PJAWT.jar" in iText for export in Eclipse so that your dependent project can use it for compilation purposes.

Danny D'Amours
  • 712
  • 8
  • 17