Hello, I hope everyone is ok,
Could someone help me to convert a barcode to a pdf file, I've tried in various ways with no success, this is what I got so far
Hello, I hope everyone is ok,
Could someone help me to convert a barcode to a pdf file, I've tried in various ways with no success, this is what I got so far
Searching the forum is always a good start...
Thank you very much!!
Sorry for bothering you, how can i make the flow to generate random qr values?
random what - numbers? strings? of a particular min/max/length?
PS, the answer is yes.
Thank you, I already did it, sorry for so many questions, but, I'm new to Node-red, this is my las question , I'm trying to get the data that you put in the csv node from the dashboard, but I haven't been able to do it, could you please help me?, this is what I got so far.
[{"id":"563638ab44dd7b74","type":"tab","label":"Flow 6","disabled":false,"info":"","env":[]},{"id":"3c9f065e1128aa4e","type":"Barcode Generator","z":"563638ab44dd7b74","name":"","data":"barras","dataType":"msg","barcode":"code39","barcodeType":"barcode","options":"","optionsType":"ui","sendProperty":"payload","props":[{"p":"rotate","v":"N","vt":"str"},{"p":"includetext","v":"false","vt":"bool"},{"p":"backgroundcolor","v":"ffffff","vt":"str"}],"x":700,"y":220,"wires":[["e6a47ac0e3ab4ceb"]]},{"id":"4b7036b0780e03e9","type":"template","z":"563638ab44dd7b74","name":"CSV data","field":"payload","fieldType":"msg","format":"javascript","syntax":"mustache","template":"var barras = global.get('cd_Barras');\nvar descripcion = global.get ('str_descripcion');\nvar numImpresiones = global.get('int_impresiones');\n\nbarras; descripcion; numImpresiones\n\n","output":"str","x":440,"y":140,"wires":[["46a18839b6ccba8c","cc8f54ef0c2e1cc1"]]},{"id":"cc8f54ef0c2e1cc1","type":"csv","z":"563638ab44dd7b74","name":"","sep":";","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"barras, descripcion, numImpresiones","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":670,"y":140,"wires":[["ea08d4655862b347"]]},{"id":"ea08d4655862b347","type":"delay","z":"563638ab44dd7b74","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"2","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":900,"y":140,"wires":[["7fac33af5f15ea28","59da013e266f59a6"]]},{"id":"7fac33af5f15ea28","type":"change","z":"563638ab44dd7b74","name":"","rules":[{"t":"set","p":"barras","pt":"msg","to":"payload.barras","tot":"msg"},{"t":"set","p":"descripcion","pt":"msg","to":"payload.descripcion","tot":"msg"},{"t":"set","p":"numImpresiones","pt":"msg","to":"payload.numImpresiones","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":220,"wires":[["3c9f065e1128aa4e"]]},{"id":"2925d53482581b31","type":"function","z":"563638ab44dd7b74","name":"Duplicate x number of times","func":"let printCount = msg.numImpresiones || 1;\n\nfor (let index = 0; index < printCount; index++) {\n msg.printNumber = index+1;\n msg.info = `${index+1} of ${printCount}`;\n node.send(msg);\n}\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":360,"wires":[["33ebb74e8d4b170d"]]},{"id":"33ebb74e8d4b170d","type":"delay","z":"563638ab44dd7b74","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"2","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":840,"y":360,"wires":[["472088e24f857b3b","0ad95c642edaaf62"]]},{"id":"472088e24f857b3b","type":"debug","z":"563638ab44dd7b74","name":"","active":false,"tosidebar":false,"console":false,"tostatus":true,"complete":"info","targetType":"msg","statusVal":"info","statusType":"auto","x":1040,"y":360,"wires":[]},{"id":"59da013e266f59a6","type":"debug","z":"563638ab44dd7b74","name":"","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":1090,"y":140,"wires":[]},{"id":"6401819b3fca9740","type":"pdfmake","z":"563638ab44dd7b74","name":"","outputType":"Buffer","inputProperty":"payload","options":"{}","outputProperty":"payload","x":720,"y":440,"wires":[["535bdd7db5709b41"]]},{"id":"0ad95c642edaaf62","type":"function","z":"563638ab44dd7b74","name":"generate pdf","func":"\nvar description = `${msg.partNumber}\\n${msg.description}`;\n\nvar dd = {\n content: [\n {\n columns: [\n {\n image: msg.image,\n width: 80\n },\n { \n width: 'auto',\n fontSize: 18,\n text: description, \n // margin: [left, top, right, bottom]\n margin: [10, 2, 10, 2]\n },\n ]\n }\n ]\n}\n\nmsg.payload = dd;\nmsg.filename = \"c:/temp/\" + msg.partNumber + \"-\" + msg.printNumber + \"-of-\" + msg.printCount + '.pdf';\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":550,"y":440,"wires":[["6401819b3fca9740"]]},{"id":"535bdd7db5709b41","type":"file","z":"563638ab44dd7b74","name":"","filename":"","appendNewline":false,"createDir":false,"overwriteFile":"true","encoding":"none","x":870,"y":440,"wires":[[]]},{"id":"e6a47ac0e3ab4ceb","type":"jimp-image","z":"563638ab44dd7b74","name":"to Base64","data":"payload","dataType":"msg","ret":"b64","parameter1":"FONT_SANS_32_BLACK","parameter1Type":"jimpFont","parameter2":"115","parameter2Type":"num","parameter3":"15","parameter3Type":"num","parameter4":"partNumber","parameter4Type":"msg","parameter5":"HORIZONTAL_ALIGN_LEFT","parameter5Type":"AlignX","parameter6":"VERTICAL_ALIGN_TOP","parameter6Type":"AlignY","parameter7":"","parameter7Type":"auto","parameter8":"","parameter8Type":"auto","sendProperty":"image","sendPropertyType":"msg","parameterCount":0,"jimpFunction":"none","selectedJimpFunction":{"name":"none","fn":"none","description":"Just loads the image.","parameters":[]},"x":860,"y":220,"wires":[["2925d53482581b31","fb39c060b30d2a3a"]]},{"id":"fb39c060b30d2a3a","type":"image viewer","z":"563638ab44dd7b74","name":"","width":"80","data":"image","dataType":"msg","active":true,"x":1030,"y":220,"wires":[[]]},{"id":"15a62daf52230736","type":"ui_form","z":"563638ab44dd7b74","name":"","label":"","group":"3782f49436c584f2","order":2,"width":0,"height":0,"options":[{"label":"Texto para el codigo de barras","value":"cd_Barras","type":"text","required":true,"rows":null},{"label":"Descripción ","value":"str_descripcion","type":"text","required":true,"rows":null},{"label":"Numero de impresiones","value":"int_impresiones","type":"number","required":true,"rows":null}],"formValue":{"cd_Barras":"","str_descripcion":"","int_impresiones":""},"payload":"","submit":"Aceptar","cancel":"Cancelar","topic":"topic","topicType":"msg","splitLayout":"","className":"","x":70,"y":140,"wires":[["52b85e41501bdd9b"]]},{"id":"52b85e41501bdd9b","type":"function","z":"563638ab44dd7b74","name":"","func":"global.set('cd_Barras',msg.payload.cd_Barras);\nglobal.set('str_descripcion',msg.payload.str_descripcion);\nglobal.set('int_impresiones',msg.payload.int_impresiones);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":220,"y":140,"wires":[["4b7036b0780e03e9"]]},{"id":"46a18839b6ccba8c","type":"debug","z":"563638ab44dd7b74","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":690,"y":20,"wires":[]},{"id":"3782f49436c584f2","type":"ui_group","name":"Codigo de barras","tab":"f7935faf25d5de3d","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"f7935faf25d5de3d","type":"ui_tab","name":"Generar codigo de barras","icon":"dashboard","order":18,"disabled":false,"hidden":false}]
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.