Skip to content

Commit bbb0943

Browse files
committed
Esc/Pos Support
1 parent 43699f3 commit bbb0943

17 files changed

+569
-438
lines changed

README.md

+23-12
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,44 @@
1-
# ZplPrinter
1+
# Zpl - Esc/Pos Printer
22

3-
Printer emulator for zpl rendering engine. The emulator is based on the [labelary](http://labelary.com/service.html) web service. You can configure print density, label size and the tcp server to listen for any incoming labels.
3+
Printer emulator for Zpl, Esc/Pos rendering engine. The emulator is based on the [labelary](http://labelary.com/service.html) web service.
4+
You can configure print density, label size and the tcp server to listen for any incoming labels.
45

5-
[Releases](https://github.com/erikn69/ZplPrinter/releases/latest)
6+
[Releases](https://github.com/erikn69/ZplEscPrinter/releases/latest)
67

7-
## New in Version 2.0
8+
## New in Version 3.0
89

9-
The app now runs standalone via Electron and can be installed via the binaries/zips on the GitHub Releases page. It currently supports:
10+
The app now emulates Epson ESC/POS. The emulator is based on the [receipt-print-hq/escpos-tools](https://github.com/receipt-print-hq/escpos-tools/blob/master/esc2html.php) repo by @mike42, and can be installed via the binaries/zips on the GitHub Releases page. It currently supports
1011

1112
* Windows:
12-
* Squarrel installer (zpl-printer-**version**-win32-**arch**-setup.exe)
13-
* Portable runner (zpl-printer-portable-**version**.exe)
14-
* NuGet package (zpl-printer-**version**-full.nupkg)
13+
* Squarrel installer (zpl-escpos-printer-**version**-win32-**arch**-setup.exe)
14+
* Portable runner (zpl-escpos-printer-portable-**version**.exe)
15+
* NuGet package (zpl-escpos-printer-**version**-full.nupkg)
1516
* msi installer (TODO)
1617
* Linux:
17-
* Rpm (zpl-printer-**version**.**arch**.rpm)
18-
* Deb (zpl-printer\_**version**\_**arch**.deb)
19-
* Zip (Zpl.Printer-linux-**arch**-**version**.zip)
18+
* Rpm (zpl-escpos-printer-**version**.**arch**.rpm)
19+
* Deb (zpl-escpos-printer\_**version**\_**arch**.deb)
20+
* Zip (Zpl-EscPos.Printer-linux-**arch**-**version**.zip)
2021
* Mac:
21-
* Zip (Zpl.Printer-darwin-**arch**-**version**.zip)
22+
* Zip (Zpl-EscPos.Printer-darwin-**arch**-**version**.zip)
23+
24+
## New in Version 2.0
25+
26+
The app now runs standalone via Electron.
2227

2328
## References
2429
* [ZPL Command Support](http://labelary.com/docs.html)
2530
* [ZPL Web Service](http://labelary.com/service.html)
2631
* [Electron](https://www.electronjs.org)
2732
* [Electron Forge](https://www.electronforge.io)
33+
* [Esc/Pos receipt print tools](https://github.com/receipt-print-hq/escpos-tools)
2834

2935
## Release notes
3036

37+
### Version 3.0
38+
* **Refactor** Reworked code
39+
* **New** Esc/Pos Support
40+
* **Fix** Bug fixes
41+
3142
### Version 2.2
3243
* **Refactor** Reworked code
3344
* **Upgrade** Bump dependencies

ZplPrinter/css/style.css ZplEscPrinter/css/style.css

+10-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,16 @@
55
display: none;
66
}
77

8-
img.thumbnail {
8+
.panel-heading-blur {
9+
background-color: #445da5 !important;
10+
border-color: #215480 !important;
11+
}
12+
13+
.label-container {
14+
height: 82vh;
15+
}
16+
17+
.label-zpl {
918
margin: 5px 0px 20px 5px;
1019
}
1120

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

ZplEscPrinter/js/main.js

+484
Large diffs are not rendered by default.

ZplPrinter/main.html ZplEscPrinter/main.html

+29-19
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
<body class="p-0 m-0">
1010
<div class="card border-0 rounded-0 h-100 w-100 mb-0">
11-
<div class="card-header text-bg-primary rounded-0">
11+
<div id="panel-head" class="card-header text-bg-primary rounded-0" style="-webkit-app-region: drag;">
1212
<img src="icons/Icon-16-white.png" class="me-2">
1313
<b><span class='panel-printer-title'>Zpl</span> Printer</b> - EN Systems</span>
14-
<button id="btn-close" type="button" class="btn-close float-end" aria-label="Close"></button>
14+
<button id="btn-close" type="button" class="btn-close float-end" aria-label="Close" style="-webkit-app-region: no-drag;"></button>
1515
</div>
1616
<div class="card-body pb-0 mb-0">
17-
<nav class="navbar navbar-light bg-light border rounded pb-1 pt-1 ps-2 pe-2 mb-3">
18-
<div class="d-flex float-start mb-0">
19-
<div id='printer-type' class="btn-group invisible" role="group" aria-label="Printer Type" style="width:1px !important;">
17+
<nav class="navbar navbar-light bg-light border rounded pb-0 pt-1 ps-2 pe-2 mb-3">
18+
<div class="d-flex float-start mb-1">
19+
<div id='printer-type' class="btn-group" role="group" aria-label="Printer Type">
2020
<input id="isZpl" name="printer-type" type="radio" class="btn-check" autocomplete="off">
2121
<label class="btn btn-outline-primary" for="isZpl" title="Zpl Printer">ZPL</label>
2222

@@ -27,7 +27,7 @@
2727
<i class="glyphicon glyphicon-send"></i>
2828
</button>
2929
</div>
30-
<div class="d-flex float-end mb-0">
30+
<div class="d-flex float-end mb-1">
3131
<div id='on_off' class="btn-group" role="group" aria-label="TCP Socket">
3232
<input id="isOn" name="tcp-socket" type="radio" class="btn-check" autocomplete="off">
3333
<label class="btn btn-outline-primary" for="isOn" title="Start TCP Socket">ON</label>
@@ -43,23 +43,26 @@
4343
</button>
4444
</div>
4545
</nav>
46-
<div class="label-container bg-light border rounded overflow-auto" style="height: 82vh;">
47-
<div id="label" class="position-relative"></div>
46+
<div id="escpos-container" class="label-container bg-light border rounded overflow-auto is-esc">
47+
<div id="label-esc" class="position-relative"></div>
48+
</div>
49+
<div id="zpl-container" class="label-container bg-light border rounded overflow-auto is-zpl">
50+
<div id="label-zpl" class="position-relative"></div>
4851
</div>
4952
</div>
5053
</div>
5154
<!-- Notification -->
5255
<div class='notifications bottom-left position-fixed w-100' style="z-index: 9999; left: 1px; bottom: 1px;"></div>
5356
<!-- Modals -->
54-
<div class="modal fade" id="printer-test" tabindex="-1" aria-labelledby="mdlPrinterTest" aria-hidden="true">
57+
<div class="modal fade" id="printer-test" tabindex="-1" aria-labelledby="mdlPrinterTest" aria-hidden="true" data-bs-backdrop="static" data-bs-keyboard="false">
5558
<div class="modal-dialog">
5659
<div class="modal-content">
5760
<div class="modal-header pb-1 pt-1 pe-3 ps-3">
5861
<h5 id="mdlPrinterTest" class="modal-title modal-title">
5962
<i class="glyphicon glyphicon-send pe-2"></i>
6063
<span class='panel-printer-title'>Zpl</span> Printer Test
6164
</h5>
62-
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
65+
<button type="button" class="btn-close btn-close-test-md" data-bs-dismiss="modal" aria-label="Close"></button>
6366
</div>
6467
<form id="testsForm" class="mb-0">
6568
<div class="modal-body">
@@ -69,29 +72,30 @@ <h5 id="mdlPrinterTest" class="modal-title modal-title">
6972
</div>
7073
</div>
7174
<div class="modal-footer p-1">
72-
<button id="btn-close-test-md" type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
73-
<button id="btn-run-test-hw" type="button" class="btn btn-success">Hello Word</button>
74-
<button id="btn-run-test" type="submit" class="btn btn-primary">Print</button>
75+
<button id="btn-close-test-md" type="button" class="btn btn-secondary btn-close-test-md" data-bs-dismiss="modal"><i class="glyphicon glyphicon-remove"></i> Close</button>
76+
<button id="btn-run-test-hw" type="button" class="btn btn-success"><i class="glyphicon glyphicon-star"></i> Hello Word</button>
77+
<button id="btn-raw-file" type="button" class="btn btn-info"><i class="glyphicon glyphicon-file"></i> Raw File</button>
78+
<button id="btn-run-test" type="submit" class="btn btn-primary"><i class="glyphicon glyphicon-print"></i> Print</button>
7579
</div>
7680
</form>
7781
</div>
7882
</div>
7983
</div>
80-
<div class="modal fade" id="settings-window" tabindex="-1" aria-labelledby="mdlLabelSettings" aria-hidden="true">
84+
<div class="modal fade" id="settings-window" tabindex="-1" aria-labelledby="mdlLabelSettings" aria-hidden="true" data-bs-backdrop="static" data-bs-keyboard="false">
8185
<div class="modal-dialog">
8286
<div class="modal-content">
8387
<div class="modal-header pb-1 pt-1 pe-3 ps-3">
8488
<h5 id="mdlPrinterTest" class="modal-title modal-title">
8589
<i class="glyphicon glyphicon-cog pe-2"></i>
8690
<span class='panel-printer-title'>Zpl</span> Printer Settings
8791
</h5>
88-
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
92+
<button type="button" class="btn-close btn-close-save-settings" data-bs-dismiss="modal" aria-label="Close"></button>
8993
</div>
9094
<form id="configsForm" class="mb-0">
9195
<div class="modal-body ps-2 pe-2">
9296
<fieldset class="border rounded p-2 mb-1">
9397
<legend class="float-none w-auto px-2 mb-0 fs-6 fw-semibold">Printer Properties</legend>
94-
<div class="row mb-2">
98+
<div class="row mb-2 is-zpl">
9599
<div class="col-7">
96100
<div class="form-floating">
97101
<select id="density" class="form-select" aria-label="Print Density">
@@ -166,14 +170,20 @@ <h5 id="mdlPrinterTest" class="modal-title modal-title">
166170
<label class="form-check-label" for="saveLabels">Save labels</label>
167171
</div>
168172
</span>
169-
<div class="form-floating">
173+
<div class="form-floating is-zpl">
170174
<select id="filetype" class="form-select" aria-label="File Type">
171175
<option value="1">PNG</option>
172176
<option value="2">PDF</option>
173177
<option value="3">RAW</option>
174178
</select>
175179
<label for="filetype">File Type</label>
176180
</div>
181+
<div class="form-floating is-esc">
182+
<select id="filetype-dump" class="form-select" aria-label="File Type" disabled>
183+
<option value="3">RAW</option>
184+
</select>
185+
<label for="filetype-dump">File Type</label>
186+
</div>
177187
</div>
178188
</div>
179189
</div>
@@ -187,8 +197,8 @@ <h5 id="mdlPrinterTest" class="modal-title modal-title">
187197
</fieldset>
188198
</div>
189199
<div class="modal-footer p-1">
190-
<button id="btn-close-save-settings" type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
191-
<button id="btn-save" type="submit" class="btn btn-primary">Save changes</button>
200+
<button id="btn-close-save-settings" type="button" class="btn btn-secondary btn-close-save-settings" data-bs-dismiss="modal"><i class="glyphicon glyphicon-remove"></i> Close</button>
201+
<button id="btn-save" type="submit" class="btn btn-primary"><i class="glyphicon glyphicon-floppy-disk"></i> Save changes</button>
192202
</div>
193203
</form>
194204
</div>
File renamed without changes.

0 commit comments

Comments
 (0)