I am looking for a way to add text on top of an existing PDF using JavaScript. I envision it as a user clicking a button to download the PDF and receiving a file with this original PDF and additional text written over the pages.
Is there any way this could be possible?
It is important to use an existing PDF to preserve the original designs on it, and the PDF also includes text specially typeset in different typefaces and a wide range of unicode glyphs.
It is also important to generate this text onto the PDF from a webpage as each text generated will be slightly different, creating a unique PDF for the end user.
I have been researching this topic online and have found the jsPDF library, but that seems to only generate PDFs, not write on top of existing PDFs, and the content I need on the PDF is too complex to use jsPDF to generate it all. I do not want to use the existing PDF as a background image if I do not have to.
I also found some backend libraries like PDFKit but would like to avoid using a backend library if at all possible — and it also doesn't seem to write over existing PDFs.
I saw some things about text-fields online, but had trouble making sense of if this would be a feasible path to take — could it be possible to add text fields in the PDF and then insert text into those fields from a webpage before the user downloads it?
Thank you very much.