AddPrinterConnection
Description (requires ScriptX v7.1 or later)
Allows printing to printers that are shared on the network but are not listed in the user's Printers and devices control panel by adding a connection to the specified printer for the current user.
The use of this method does not select the connected printer for printing.
This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation. Calling this function could make Internet Explorer/the application appear to be unresponsive temporarily.
NOTE: Only use this function where a connection has already been made (and removed) before, in other words, where the required printer drivers are already available.
Syntax
printing.AddPrinterConnection(sharename)
Parameter |
Description |
sharename |
The name of the printer to connect to. |
Example
Here is a basic example of use
<body>
<script>
function connectPrinter(printerName) {
try {
factory.printing.AddPrinterConnection(printerName);
factory.printing.printer = printerName;
} catch (e) { alert("Failed to connect to printer: " + e.message); }
}
</script>
<button id="idConnect" onclick="connectPrinter("\\netserver\brother1")">Connect</button>
</body>
Applies To
Client use only, not server. printing
See Also
RemovePrinterConnection, currentPrinter, printer