Android - how to convert html to pdf? [duplicate]

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?

1 1 1 silver badge asked Dec 29, 2011 at 14:30 user958904 user958904 111 1 1 gold badge 1 1 silver badge 2 2 bronze badges

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.

Commented Dec 29, 2011 at 14:44

1 Answer 1

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

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:

1 1 1 silver badge answered Dec 29, 2011 at 14:41 TryTryAgain TryTryAgain 7,780 13 13 gold badges 48 48 silver badges 84 84 bronze badges

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.

Commented May 18, 2013 at 3:20

@huygir did you see the duplicate answer? stackoverflow.com/questions/2499960/… 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.