由于你发布的链接关于驱动程序需求的讨论,我假设你有相当数量控制机器的软件?如果是这种情况,你可以使用Firefox,那么名为JS Print Setup的插件可能会起作用。
它基本上使网页能够直接打印到用户计算机上的打印机而无需打印对话框。
我认为只要提供合适的尺寸,它就会打印出标签,但我没有测试过。当打印机没有连接并且确实发送给打印机的队列时,我做了测试,所以肯定会告诉系统打印文件。
下面是从文档一个代码示例: (看样子,它可以让你设置页边距,一切为好。)
<script>
// set portrait orientation
jsPrintSetup.setOption('orientation', jsPrintSetup.kPortraitOrientation);
// set top margins in millimeters
jsPrintSetup.setOption('marginTop', 15);
jsPrintSetup.setOption('marginBottom', 15);
jsPrintSetup.setOption('marginLeft', 20);
jsPrintSetup.setOption('marginRight', 10);
// set page header
jsPrintSetup.setOption('headerStrLeft', 'My custom header');
jsPrintSetup.setOption('headerStrCenter', '');
jsPrintSetup.setOption('headerStrRight', '&PT');
// set empty page footer
jsPrintSetup.setOption('footerStrLeft', '');
jsPrintSetup.setOption('footerStrCenter', '');
jsPrintSetup.setOption('footerStrRight', '');
// clears user preferences always silent print value
// to enable using 'printSilent' option
jsPrintSetup.clearSilentPrint();
// Suppress print dialog (for this context only)
jsPrintSetup.setOption('printSilent', 1);
// Do Print
// When print is submitted it is executed asynchronous and
// script flow continues after print independently of completetion of print process!
jsPrintSetup.print();
// next commands
</script>
的附加可以在这里找到Mozilla的附加现场:
https://addons.mozilla.org/en-US/firefox/addon/js-print-setup/
来源
2013-04-20 08:22:03
Key
也许你可以看看[这里](http://stackoverflow.com/questions/7891259/can-i-have-javascript-select-printer-to-use)自动选择打印机。 –