Trivial HTTP Server for ESC/POS to HTML converter (escpos-tools)
405
This repository provides command-line utilities for extracting information from binary ESC/POS data. ESC/POS is a page description language that is commonly used for receipt printing.
Currently we have a prototype ESC/POS parser, which can extract the commands contained in printable ESC/POS binary data, and render them to various formats.
This project is requires:
mbstring and imagick extensionsTo install from source:
git clone https://github.com/receipt-print-hq/escpos-tools
cd escpos-tools
composer install
esc2text extracts text and line breaks from binary ESC/POS files.
esc2html converts binary ESC/POS files to HTML.
escimages extracts graphics from binary ESC/POS files in PBM and PNG format.
In order to start escpos to esc2html as a trivial HTTP API:
php -S 0.0.0.0:8000 esc2html.php
Now, sending an HTTP POST query with receipt parameter with the receipt (coded in Base64)
To get the Base64 data:
base64 -w 0 receipt-with-logo.bin
To use the trivial API:
curl http://localhost:8000 -d "receipt=<base64_receipt>"
Content type
Image
Digest
Size
247 MB
Last updated
over 5 years ago
docker pull ferimer/escpos2html