@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.)