If you need to create a PDF file from your application on Android, here is a piece of code that will show you how to easily do that, with unlimited number of lines that you can write to the PDF :
https://gist.github.com/reuniware/a89b505197f41a28ab334aa1049b989b#file-pdfwriter-kt