Parzibyte's blog

Free knowledge blog: linux, programming, open source, databases, android, frameworks, web and computing in general

Print receipt in thermal printer using JavaScript, CSS & HTML

In this post I will show you how to print a ticket or receipt by using JavaScript (client side) and a thermal printer. At the end we will have a great ticket that looks like this:

Ticket sample

Receipt printed in thermal printer using JavaScript only

Obviously you can change the font family, size, logo and so on. And remember: we will be using only pure CSS, HTML & JavaScript, no frameworks; though you can use any framework to render the content before printing.

You can see the demo here, and the full code on my GitHub.

(more…)