Skip to content

namshi/qzprinty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

Pass an HTML to the print function

let qzp = new qzPrinty();
qzp.print(htmlToPrint);

By default, the printer name in use is "Zebra-Technologies-ZTC-ZT230-200dpi-ZP" You can specify a printer name in options like so:

let qzp = new qzPrinty({ printer: "My printer name" });

You can also pass printer settings, for example:

let qzp = new qzPrinty({ 
	printer: 'qr-printer', 
	settings: { 
		units: 'in', 
		size: { 
			width: 4, 
			height: 6 
		}, 
		rasterize: false 
	} 
});

You can find all settings on the qz.io config page: https://qz.io/api/qz.configs

You can also print pdf files as such:

qzp.print(pathToPdf/URL, 'pdf');

To print multiple times, pass the values in an array, example:

qzp.print([html1, html2, html3]);

About

A simple utility to print html using qz tray

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published