Make a PDF file

#1

Can Node-RED make a PDF from string msg.payload ? I'm trying make a flow like this:


but the pdf file cant opened. Is it possible to make a pdf file with Node-RED ?

0 Likes

#2

Node-RED doesn't have built-in pdf functionality.
There's a third party node that seems to do this however:

0 Likes

#3

@Popo21 You did not say whether you are running on linux or something else. If linux, you can search Google for something like "linux text to pdf" and get a bunch of suggestions, all of which convert text files to pdf, either directly or through an intermediate postscript file. Your flow diagram suggests (I can't see into the function node) that you want to write the pdf file line-by-line. I doubt that this is possible, since pdf is a document format, and a pdf generator will want to see the entire document before it starts producing output -- hence, file-to-file conversion. I hope this helps.

@nlecaude I noticed this node also, but I doubt it does what it says on the tin. The node has been renamed on npm and GitHub as node-red-contrib-render. I haven't tried it, but it seems to be an improved template node and not really much to do with pdf. (PS, I wonder whether the NR flow library is set up to track this sort of thing.)

0 Likes

How can i append to PDF file in Node-Red?
#4

Thank You for your attention.
I run that on raspberry, I try to use node-red-contrib-pdf node but give me error, now I'm trying use an API to convert txt to pdf, but how to save that file to my PI?
I'm trying this:

0 Likes

#5

For now i think i will make that file as .odt file, thank you for your attention.

0 Likes

#6

have you find a solution for pdf file

0 Likes

#7

I design a pdf form from html / template node, then the HTML form injected to file node. After that, a html file format created which can be transformed to pdf by drag that file to chromium and right click -> print -> save as pdf

1 Like

#8

Thanks for reply. I will try it.
You dont use HTML-PDF NODE ? Right?

0 Likes

#9

yeah, just template and file node

0 Likes