It is necessary having a document template, fill in the fields in it, and save after. All this is done programmatically, from within the Android application. There are two options:

  1. There is a .pdf file. Fill in the fields in it and save it
  2. There is a .doc file. Fill in the fields in it, convert it to .pdf and save.

The problem is that you cannot use commercial libraries, and libraries with licenses that require opening source code. Most of the answers that I found were quite ancient, I think during this time new libraries came out. Or the libraries that they consulted do not have documentation.

    1 answer 1

    You can use the iText library to create and edit .pdf documents (link: https://itextpdf.com/en/resources/downloads ). Some libraries (for example iText 7 Core) have a commercial license. But pdfHTML is open source and completely free. PdfHTML allows you to convert HTML-code into a .pdf file. I can also advise the PDFBox library ( https://pdfbox.apache.org ).