node-red-contrib-tcp-escpos 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/nodes/node.html +45 -15
- package/package.json +1 -1
package/nodes/node.html
CHANGED
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
<label for="node-input-dotsPerLine"
|
|
48
48
|
><i class="fa fa-ruler-horizontal"></i> Dots per line</label
|
|
49
49
|
>
|
|
50
|
-
<input type="number" id="node-input-dotsPerLine"
|
|
50
|
+
<input type="number" id="node-input-dotsPerLine" min="8" step="8" />
|
|
51
51
|
</div>
|
|
52
52
|
<div class="form-row">
|
|
53
53
|
<label for="node-input-payloadType"
|
|
@@ -73,21 +73,51 @@
|
|
|
73
73
|
</div>
|
|
74
74
|
</script>
|
|
75
75
|
<script type="text/html" data-help-name="tcp escpos">
|
|
76
|
-
<p>
|
|
76
|
+
<p>Sends raw text, images, or buffers to an ESC/POS-compatible printer over TCP/IP.</p>
|
|
77
|
+
|
|
78
|
+
<h3>Configuration</h3>
|
|
79
|
+
<dl class="message-properties">
|
|
80
|
+
<dt>Host</dt>
|
|
81
|
+
<dd>The IP address and port of the printer (e.g., <code>192.168.1.101:9100</code>). If the port is omitted, it defaults to <code>9100</code>.</dd>
|
|
82
|
+
<dt>Dots per line</dt>
|
|
83
|
+
<dd>The maximum width of the paper in dots. This is used to scale down images that are too wide. The default is <code>576</code>.</dd>
|
|
84
|
+
<dt>Type</dt>
|
|
85
|
+
<dd>The type of data to send to the printer. This can be <code>Text</code>, <code>Image</code>, or <code>Buffer</code>.</dd>
|
|
86
|
+
<dt>Payload</dt>
|
|
87
|
+
<dd>The content to send to the printer. The format depends on the selected <code>Type</code>.</dd>
|
|
88
|
+
<dt>Cut After</dt>
|
|
89
|
+
<dd>If checked, the printer will cut the paper after the payload has been printed.</dd>
|
|
90
|
+
</dl>
|
|
91
|
+
|
|
92
|
+
<h3>Payload Types</h3>
|
|
93
|
+
<dl class="message-properties">
|
|
94
|
+
<dt>Text</dt>
|
|
95
|
+
<dd>The payload should be a string of text. The node will automatically center the text and add a newline character at the end.</dd>
|
|
96
|
+
<dt>Image</dt>
|
|
97
|
+
<dd>
|
|
98
|
+
The payload can be one of the following:
|
|
99
|
+
<ul>
|
|
100
|
+
<li>A Buffer containing the image data.</li>
|
|
101
|
+
<li>A base64 encoded string.</li>
|
|
102
|
+
<li>A data URL (e.g., <code>data:image/png;base64,...</code>).</li>
|
|
103
|
+
<li>A URL (<code>http</code>, <code>https</code>, or <code>file</code>).</li>
|
|
104
|
+
<li>A file path.</li>
|
|
105
|
+
</ul>
|
|
106
|
+
The image will be dithered and converted to monochrome before printing. If the image is wider than the <code>Dots per line</code> setting, it will be scaled down to fit.
|
|
107
|
+
</dd>
|
|
108
|
+
<dt>Buffer</dt>
|
|
109
|
+
<dd>The payload can be a Buffer or an array of bytes. This allows you to send raw ESC/POS commands to the printer.</dd>
|
|
110
|
+
</dl>
|
|
111
|
+
|
|
77
112
|
<h3>Inputs</h3>
|
|
78
113
|
<dl class="message-properties">
|
|
79
|
-
<dt>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
</
|
|
83
|
-
<
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
<span class="property-type">object</span>
|
|
88
|
-
</dt>
|
|
89
|
-
<h3>Details</h3>
|
|
90
|
-
<p>Some more information about the node.</p>
|
|
91
|
-
</dl>
|
|
114
|
+
<dt>payload</dt>
|
|
115
|
+
<dd>The payload to be sent to the printer. This will override the <code>Payload</code> setting in the node's configuration.</dd>
|
|
116
|
+
<dt>host</dt>
|
|
117
|
+
<dd>The host to connect to. This will override the <code>Host</code> setting in the node's configuration.</dd>
|
|
118
|
+
<dt>dotsPerLine</dt>
|
|
119
|
+
<dd>The dots per line to use. This will override the <code>Dots per line</code> setting in the node's configuration.</dd>
|
|
120
|
+
<dt>cutAfter</dt>
|
|
121
|
+
<dd>Whether to cut the paper after printing. This will override the <code>Cut After</code> setting in the node's configuration.</dd>
|
|
92
122
|
</dl>
|
|
93
123
|
</script>
|