I’m not sure if that would be desired solution for you, but you could made template of document (current website) and inject the values from the form and compile with handlebars. Then use puppeteer to generate .pdf from that template.
It’s not the straight forward solution, but could work. I made something like that for my CV creator website. You may wish to check the code: https://github.com/Vastlaan/royalresumegenerator
I hope its helpfull