I’m now working on a project that requires to print some labels.
I can print ONE label (which are html elements) with js “print” function, in this case user need to configure the printer once. But could I print MANY different labels but configure once?
the js printing code is:
function printElement(elem){
var win = window.open();
self.focus();
win.document.open();
win.document.write('<html><head> </head><body>');
win.document.write(elem);
win.document.write('</body></html>');
win.document.close();
win.print();
win.close();
}
Note: the paper to print have gaps, like sticky notes, so that user can tear them one by one easily. So I cannot write all the elements on one html and print it.
Get the number of labels to print, then:
In place of your current writing
elem.