https://github.com/receipt-print-hq/escpos-tools/blob/master/doc/esc2html.md
1.7K
This repository is for converting an escpos .bin file into a html for simulating an escpos printing.
Usage:
Cd to the location of the bin, and just run:
Windows/Powershell/cmd
powershell.exe -Command docker run -v "${PWD}:/app/input" -v "${PWD}:/app/output" xabdullahx/esc2html input.bin
Linux:
docker run -v "${pwd}:/app/input" -v "${pwd}:/app/output" xabdullahx/esc2html input.bin
(Not tested, but should work in the same way)
If you want to use other tools from the escpos-tools, you have to create your own image. This is the Dockerfile used to build this image:
# Use PHP 7.4 as base image (stable version with good compatibility)
FROM php:7.4-cli
# Install required dependencies
RUN apt-get update && apt-get install -y \
git \
unzip \
libmagickwand-dev \
libonig-dev
RUN rm -rf /var/lib/apt/lists/*
# Install PHP extensions
RUN docker-php-ext-install mbstring
RUN pecl install imagick && docker-php-ext-enable imagick
# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Create working directory
WORKDIR /app
# Clone the escpos-tools repository
RUN git clone https://github.com/receipt-print-hq/escpos-tools .
# Install dependencies using composer
RUN composer install
# Create input and output directories
RUN mkdir -p /app/input /app/output
# Create an entrypoint script
RUN echo '#!/bin/sh\n\
php esc2html.php /app/input/$1 > /app/output/output.html' > /app/entrypoint.sh \
&& chmod +x /app/entrypoint.sh
ENTRYPOINT ["/app/entrypoint.sh"]
Content type
Image
Digest
sha256:e3e9c3c90…
Size
280.7 MB
Last updated
almost 2 years ago
docker pull xabdullahx/esc2html