I am having an already existing implementation of drawing PDF-s in SpringBoot with Apache PdfBox library.
However, now there is a requirement to add text with HTML tags to an existing document.
From what I have researched, PDFBox does not recognize HTML tags, so I reached for openhtmltopdf library. But, I am having issues doing so, don't know how to pass the current location of the document I want the text to be appended to. Also, I need to extract the location to where the next text should be appended to.
Is it possible to do it with this library, or you suggest some other option?
PdfBoxRenderer renderer = new PdfRendererBuilder()
.withProducer(htmlText)
.usePDDocument(document)
.buildPdfRenderer();
renderer.layout();
renderer.createPDFWithoutClosing();
renderer.close();