I have web application and it have a print function. It simply print some HTML aligned content using a Dot matrix printer. But in web application it prints in Graphics mode, due to this printing is very slow. So I tried the solution using the link. My print method as follows:
var data=[].slice.call($("#printdiv").find("table tr")).map(function(row){
return row.textContent.trim().replace(/\n/g,"\t");
}).join("\n");
window.open("data:application/print;," + escape(data));
My print.bat
as follows:
notepad /p %1
When I click print button it simply download a file and then it needs to be open with print.bat file to print and it works perfectly.
How can I automate that. I mean on clicking print function I want call the print.bat file and need to pass the content or notepad file to the bat file and should work without manual intervention.
I tried to call .bat file using ActiveXObject but it is not working in anywhere (not even working in IE).
How can I automate calling .bat file from browser using javascript/jquery and automate printing?