How can I automatically get a label to print?
In the GUI application for Delivery Manager, we use Adobe Acrobat to print labels. As Delivery Manager is a web application hosted in the Internet, we can't actually see the customers' printers. We can, however, pass labels back to the browser and then get the browser to print them.
We effectively make a self-printing PDF; once the label is opened, it automatically prints. The JavaScript to embed is as follows:
var pp = this.getPrintParams(); pp.pageHandling = pp.constants.handling.none; pp.interactive = pp.constants.interactionLevel.silent; pp.printerName = "\\machine\printer"; this.print(pp);
The "pp.constants.handling.none" parameter stops automatic scaling, which often leads to poor-quality barcodes.
It is important to note that this only works if it is a secured script. You should implement that as a function in a JavaScript file, and put that file into the scripts folder of Acrobat Reader. When you need to print a label, you embed a call to that function instead, perhaps identifying the target printer:
printDocument("\\machine\printer");
The net effect of all this is that when the label is downloaded, Acrobat Reader (or the ActiveX control) will open the PDF, causing it to print.

