Create a PDF with Node-Red and JSON

Hello everyone
I want to generate a pdf-file in Node-Red and use "node-red-contrib-pdfmake".
With the inject node I enter a json "content". Now my question, how do I create a layout in this file and can I add more text that is not in json format?
Below how I do this.

In addition, I cannot open the pfd file as long as node-red is running. What could be the reason for this?

Thanks for your help. Kind regards Mauri

Hi & welcome to the forum.

Yes. Check out the built in example (CTRL-I --> examples --> PDFMAKE)

Also, search the forum (there was a PDFMAKE thread only this week that will give you clues on how to generate sections)

Because using a fixed file name keeps the file open (for later additions)

In simple terms, dont specify a fixed file name, instead, pass the filename in via msg.filename as is explained in the file node built in help.

Have a look at this thread and the link to some examples.

Thanks for your fast answers!

Can you link the thread please? I can't find it

:point_up_2: Look up :point_up_2:

:wink:

Try this entry in particular from that thread

It demonstrates a few techniques - in particular adding text dynamically to the PDF document definition

:man_facepalming:t5: :see_no_evil:

Thanks a lot! :pray:t5:

1 Like