I did it! Creating a PDF on the server based on a template prepared in MS Word or MS Excel (probably in other software too – needs testing). Data from the database or a user form is inserted in place of tokens within the document. And yes, it turned out to be insanely difficult (but now I know a ton about PDFs).
There are several complications for which there is no neat solution yet. 1) only two monospaced fonts 2) of course, the text from the template does not flow onto the next page if the insertion is larger than the reserved space 3) the template needs to include invisible text with all the variety of characters [to enhance the PDF dictionary for that particular font] 4) Theoretically, in some new or old version, or due to some clever block placement or specific settings, Word may generate PDFs that my code does not understand. Theoretically.

