i didnt find it at all on search... I have a page with a div that shows the data chosen to print on a thermal printer. I'm using a simple js to print it. It works, but my thermal printer its printing it poorly, and some other posts point that if you just send it print, it will try to print a bit like images, making it unreadable. So, what I hope to make its to modify the print js code to transform it to text (keeping the table/line order) before send it to print. If possible, I want to force the page to refresh it after print.
print.js
document.getElementById("doPrint").addEventListener("click", function() {
var printContents = document.getElementById('printMe').innerHTML;
var originalContents = document.body.innerHTML;
document.body.innerHTML = printContents;
window.print();
document.body.innerHTML = originalContents;
});
I'm self learner, so if i didnt make it clear enough i hope friends will bear with me. Of course, if you have other alternatives that works, i'm open to it.