Skip to content

A WYSIWYG editor that prints pure HTML to a thermal printer, from the cloud

Notifications You must be signed in to change notification settings

madebycm/thermal_wysiwyg_cloud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

thermal_wysiwyg_cloud

A WYSIWYG editor that prints pure HTML to a thermal printer, from the cloud. It works by using PhantomJS to headlessly generate a capture.png file from the markup which it then can print.

Example implementation using a simple shell script (after hosting the server):

#!/bin/sh
# generate the capture on backend
wget -O /dev/null http://localhost:9911/cap # this URL should be kept secret

# delete cache
rm -f capture.png

# get the new capture
wget http://localhost:9911/capture.png

# sky.py wils use this and print
python sky.py

Where sky.py looks like:

# https://github.com/adafruit/Python-Thermal-Printer
from Adafruit_Thermal import *
import Image

printer = Adafruit_Thermal("/dev/ttyAMA0", 19200, timeout=5)
img = Image.open('capture.png')

printer.printImage(img, True)
printer.feed(4)

# It's that simple!

About

A WYSIWYG editor that prints pure HTML to a thermal printer, from the cloud

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published