Sign inSign up

ferimer/escpos2html

By ferimer

•Updated over 5 years ago

Trivial HTTP Server for ESC/POS to HTML converter (escpos-tools)

Image
0

405

ferimer/escpos2html repository overview

⁠ESC/POS command-line tools Build Status

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.

⁠Quick start

This project is requires:

  • PHP 5.6 or better
  • The mbstring and imagick extensions
  • composer⁠

To install from source:

git clone https://github.com/receipt-print-hq/escpos-tools
cd escpos-tools
composer install

⁠Included utilities

⁠esc2text

esc2text extracts text and line breaks from binary ESC/POS files.

⁠esc2html

esc2html converts binary ESC/POS files to HTML.

⁠escimages

escimages extracts graphics from binary ESC/POS files in PBM and PNG format.

⁠Execute HTTP Server

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>"

⁠Contribute

⁠Licensing

Tag summary

Content type

Image

Digest

Size

247 MB

Last updated

over 5 years ago

docker pull ferimer/escpos2html