androidkotlinpdfpdftron

How to fill an editable PDF with stored data in Kotlin?


I'm coding an application on Android Studio using Kotlin. For now, I have one fragment where the user has to fill some fields (like "Client", "Date", etc) and I'd like to put these information in an editable PDF that already exists when the user clicks on a "Validate" button. I searched for hours, but the only solution I found is called "Pdftron", but I couldn't make it work without the (4000$/year) license. Is there any way I can fill the PDF using Kotlin? Does anyone know how to use properly the demo version of Pdftron?

Thank you in advance.

Here is a screenshot of the existing editable PDF as an example:

IMAGE

EDIT: Someone sent me this: https://pdfbox.apache.org/, that could help me. I'll dig that tomorrow, but I'm still open to any suggestion :)


Solution

  • I finally managed to do what I wanted, with a lib called "iText 7", and it works perfectly with Android. Doc is here: https://api.itextpdf.com/iText7/java/7.1.12/