Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smolsoftboi/node-zpl
Build, tweak and render individual labels.
https://github.com/smolsoftboi/node-zpl
node zpl
Last synced: about 16 hours ago
JSON representation
Build, tweak and render individual labels.
- Host: GitHub
- URL: https://github.com/smolsoftboi/node-zpl
- Owner: SmolSoftBoi
- Created: 2020-07-16T15:56:06.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-09-23T01:59:05.000Z (about 2 months ago)
- Last Synced: 2024-10-06T22:34:40.709Z (about 1 month ago)
- Topics: node, zpl
- Language: TypeScript
- Homepage:
- Size: 1.01 MB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# ZPL
Build, tweak and render individual labels.```ts
import { default as Zpl } from '@epickris/zpl';
import * as ZplCommands from '@epickris/zpl/dist/commands';const zpl = new Zpl();
zpl.addZpl([
ZplCommands.comment('Top section with logo, name and address.'),
ZplCommands.changeAlphanumericDefaultFont(0, 60),
ZplCommands.fieldOrigin(50, 50),
ZplCommands.graphicBox(100, 100, 100),
ZplCommands.FIELD_SEPARATOR,
ZplCommands.fieldOrigin(75, 75),
ZplCommands.FIELD_REVERSE_PRINT,
ZplCommands.graphicBox(100, 100, 100),
ZplCommands.FIELD_SEPARATOR,
ZplCommands.fieldOrigin(93, 93),
ZplCommands.graphicBox(40, 40, 40),
ZplCommands.FIELD_SEPARATOR,
ZplCommands.changeAlphanumericDefaultFont(0, 30),
ZplCommands.fieldOrigin(220, 115),
ZplCommands.fieldData('1000 Shipping Lane'),
ZplCommands.FIELD_SEPARATOR,
ZplCommands.fieldOrigin(220.155),
ZplCommands.fieldData('Shelbyville TN 38102'),
ZplCommands.FIELD_SEPARATOR,
ZplCommands.fieldOrigin(220, 195),
ZplCommands.fieldData('United States (USA)'),
ZplCommands.FIELD_SEPARATOR,
ZplCommands.fieldOrigin(50, 250),
ZplCommands.graphicBox(700, 1, 3),
ZplCommands.FIELD_SEPARATOR,ZplCommands.comment('Second section with recipient address and permit information.'),
ZplCommands.changeAlphanumericDefaultFont('A', 30),
ZplCommands.fieldOrigin(50, 300),
ZplCommands.fieldData('John Doe'),
ZplCommands.FIELD_SEPARATOR,
ZplCommands.fieldOrigin(50, 380),
ZplCommands.fieldData('100 Main Street'),
ZplCommands.FIELD_SEPARATOR,
ZplCommands.fieldOrigin(50, 380),
ZplCommands.fieldData('Springfield TN 39021'),
ZplCommands.FIELD_SEPARATOR,
ZplCommands.fieldOrigin(50, 420),
ZplCommands.fieldData('United States (USA)'),
ZplCommands.FIELD_SEPARATOR,
ZplCommands.changeAlphanumericDefaultFont('A', 15),
ZplCommands.fieldOrigin(600, 300),
ZplCommands.graphicBox(150, 150, 3),
ZplCommands.FIELD_SEPARATOR,
ZplCommands.fieldOrigin(638, 340),
ZplCommands.fieldData('Permit'),
ZplCommands.FIELD_SEPARATOR,
ZplCommands.fieldOrigin(638, 390),
ZplCommands.fieldData('123456'),
ZplCommands.FIELD_SEPARATOR,
ZplCommands.fieldOrigin(50, 500),
ZplCommands.graphicBox(700, 1, 3),
ZplCommands.FIELD_SEPARATOR,ZplCommands.comment('Third section with barcode.'),
ZplCommands.barCodeFieldDefault(5, 2, 270),
ZplCommands.fieldOrigin(100, 550),
ZplCommands.code128BarCode(),
ZplCommands.fieldData('12345678'),
ZplCommands.FIELD_SEPARATOR,ZplCommands.comment('Fourth section (the two boxes on the bottom).'),
ZplCommands.fieldOrigin(50, 900),
ZplCommands.graphicBox(700, 250, 3),
ZplCommands.FIELD_SEPARATOR,
ZplCommands.fieldOrigin(400, 900),
ZplCommands.graphicBox(1, 250, 3),
ZplCommands.FIELD_SEPARATOR,
ZplCommands.changeAlphanumericDefaultFont(0, 40),
ZplCommands.fieldOrigin(100, 960),
ZplCommands.fieldData('Ctr. X34B-1'),
ZplCommands.FIELD_SEPARATOR,
ZplCommands.fieldOrigin(100, 1010),
ZplCommands.fieldData('REF1 F00B47'),
ZplCommands.FIELD_SEPARATOR,
ZplCommands.fieldOrigin(100, 1060),
ZplCommands.fieldData('REF2 BL4H8'),
ZplCommands.FIELD_SEPARATOR,
ZplCommands.changeAlphanumericDefaultFont(0, 190),
ZplCommands.fieldOrigin(470, 955),
ZplCommands.fieldData('CA'),
ZplCommands.FIELD_SEPARATOR
]);console.log(zpl.getZpl());
```