9

Possible Duplicate:
How to create PDFs in Android SDK?

I have an html file in my android application, which I want to save in pdf format? Please let me know how to do it?

Community
  • 1
  • 1
user958904
  • 111
  • 1
  • 1
  • 2
  • Wait, are you asking how to do this as a user or how to do it as a programmer? If you are a programmer, I gave a solution below. – TryTryAgain Dec 29 '11 at 14:44

1 Answers1

4

Taken directly from another SO post How to create PDFs in an Android app?:

if anyone wants to generate PDFs on Android device, here is how to do it:

http://sourceforge.net/projects/itext/ (library)

http://www.vogella.de/articles/JavaPDF/article.html (tutorial)

http://tutorials.jenkov.com/java-itext/image.html (images tutorial)

According to user comments from SourceForge and the comment below this solution, the iText library has changed quite a bit. I strongly recommend taking this advice with a grain of salt, and urge you to go through the solutions provided in the duplicate answer:

How to create PDFs in an Android app?

Community
  • 1
  • 1
TryTryAgain
  • 7,632
  • 11
  • 46
  • 82
  • 2
    Fail. The itext jars do not work on Android, and the "android compatible" versions are not like the originals when it comes to converting HTML using the XMLWorker. There are also redundant inclusions of a Base64 library so that your app will not build due to the awful "dex multiple versions" error. The example app is shallow, only showing one very simple example. I wasted hours trying to use the Android itext to convert HTML and save with no success. A product with a paid license should work and be better documented. – huygir May 18 '13 at 03:20
  • 1
    @huygir did you see the duplicate answer? http://stackoverflow.com/questions/2499960/how-to-create-pdfs-in-android-sdk It has the most upvotes. The problem is, the answer is from 2010 and mine was from 2011...a lot can happen in that time. I will note that this doesn't provide a solution anymore. It's impossible for me to spot check all my given solutions to answers based on the way in which examples and applications have changed or developed. I appreciate you bringing it to our attention. – TryTryAgain May 20 '13 at 20:58