In my SAPUI5 application I am using RichTextEditor which is based on TinyMCE. The problem is that there is no supported way to export the document to PDF or any other file.
When in Chrome and focused inside RichTextEditor
element, after pressing Ctrl+P (print) I am able to print the content of the TinyMCE into a PDF file using native chrome pdf printer.
My question is: Is it somehow possible to simulate this in nodejs app to avoid user interaction at all? I am asking for some pointers how this could be done.
Calling the getValue
method on your RichTextEditor control, you can export the current content as an html string.
If you send this to your nodejs layer, you should be able to convert this to a pdf, using a converter, such as this one.
This works, however I ended up using puppeteer. It is possible to retrieve inner HTML and print only that content.