Hey
I am trying to convert a pdf to text.
I can already set up the PDf filename. However, I am not able to convert the PDF to text.
I am using "node-red-contrib-pdfjs" but I am not getting any output.
What am I doing wrong?
I create several PDFs according to the given username. At a later time I would like to read the most recent PDF from the specified user. The path to the file is correct.
I am using an NR server on Windows.
Thank you!
Example flow:
Flow:
[{"id":"a32031c0.1e4e6","type":"function","z":"90af3ff8.12c38","name":"Combine data","func":"var combined = [];\n\nfor (var i = 0; i < msg.files.length; i++) {\n var file = msg.files[i];\n var stat = msg.stats[i];\n \n combined.push({\n path: msg.payload,\n file,\n ...stat\n })\n}\n\ncombined.sort((a, b) => b.birthtimeMs - a.birthtimeMs);\n\nmsg.combined = combined;\n\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2540,"y":1980,"wires":[["cb7bfed7.2054a"]]},{"id":"cb7bfed7.2054a","type":"change","z":"90af3ff8.12c38","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"combined[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2720,"y":1980,"wires":[["e2d8e2c0.ac175"]]},{"id":"708a4632.32f038","type":"comment","z":"90af3ff8.12c38","name":"Load last session","info":"","x":1800,"y":1940,"wires":[]},{"id":"a35ab831.b35fa8","type":"fs-ops-stats","z":"90af3ff8.12c38","name":"","path":"payload","pathType":"msg","filename":"files","filenameType":"msg","stats":"stats","sizeType":"msg","x":2380,"y":1980,"wires":[["a32031c0.1e4e6"]]},{"id":"875210a9.7dbcc","type":"fs-ops-dir","z":"90af3ff8.12c38","name":"","path":"payload","pathType":"msg","filter":"*.pdf","filterType":"str","dir":"files","dirType":"msg","x":2240,"y":1980,"wires":[["a35ab831.b35fa8"]]},{"id":"e6e9cd85.dc04a","type":"ui_button","z":"90af3ff8.12c38","name":"","group":"53c90cc8.980784","order":11,"width":0,"height":0,"passthru":false,"label":"Import last session","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":1810,"y":1980,"wires":[["6476160c.378168"]]},{"id":"6476160c.378168","type":"function","z":"90af3ff8.12c38","name":"Generate filepath user","func":"var voornaam = flow.get(\"rapportdata.voornaam\");\nvar achternaam = flow.get(\"rapportdata.achternaam\");\n\nvar bestand = \"C:/Users/Arne/Desktop/Rapport/\" + achternaam + \"_\" + voornaam + \"/\";\nmsg.payload = bestand;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2060,"y":1980,"wires":[["875210a9.7dbcc"]]},{"id":"e2d8e2c0.ac175","type":"function","z":"90af3ff8.12c38","name":"Total filepath","func":"var path = msg.payload.path\nvar file = msg.payload.file\n\nvar filepath = path + file; \nmsg.payload = filepath;\n\nreturn msg;\n\n\n// msg.payload = {file: filepath};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2030,"y":2040,"wires":[["973141e9.2019b"]]},{"id":"87182c66.4a1d3","type":"debug","z":"90af3ff8.12c38","name":"Debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":2370,"y":2040,"wires":[]},{"id":"973141e9.2019b","type":"pdf","z":"90af3ff8.12c38","name":"","filename":"","sortByY":false,"sortByX":false,"combineColumn":false,"combineRow":false,"x":2230,"y":2040,"wires":[["87182c66.4a1d3"],["87182c66.4a1d3"]],"outputLabels":["msg.payload",""]},{"id":"53c90cc8.980784","type":"ui_group","z":"","name":"Overzicht","tab":"8a5a79f8.19dec8","order":3,"disp":true,"width":"6","collapse":false},{"id":"8a5a79f8.19dec8","type":"ui_tab","z":"","name":"Automatische Mode","icon":"loop","order":3,"disabled":false,"hidden":false}]