Printing Raw/ESC

Read File Node

There are four options for "Output":

  1. a single utf8 string
  2. a msg per line
  3. a single Buffer object
  4. a stream of Buffers

Is option 3 able to open and put a whole file in a single Buffer object that can be accepted by a "TCP OUT" node?

Is option 4 able to open and cut a whole file into a stream of Buffer objects that can be accepted by a "TCP OUT" node?

I think in this case, I want option four, but I need to know the buffer size. My node red is running on a Windows Server 2019 VM.

I'm using an Epson label printer. I'm printing using raw/esc commands. I can send a print job and print it successfully. I just read a text file with the print commands etc., and send it to the Printer with the "TCP out" node.

I need to send a font file. (TTF) I need to send an image file. (PNG)

The printer needs to know the file size, which I think I am sending correctly.

The printer needs to know the "Data size per line [byte]". I'm assuming the "Data size per line [byte]" is the buffer size?

My biggest font file is a little over 2MB. My biggest image size is 50KB.

in option 4 it reads a file a "chunk" at a time - the chunk size depends on the operating system. I can't recall what it is on Windows. The easiest way would be set it to read a large file and then use a function node to report msg.payload.length of each chunk, and check they are consistent.

Though the last chunk will always be made up of any remaining bytes so will always vary in size.

Thank you, sir. It turns out that the "size per line" parameter wasn't important, at least not on Epson label printers using RAW, it can be left at "0". I did however, have to convert the files to binary and include them in the text file that was sent over TCP.