EnumPrinters
Description
Enumerates locally-available printers.
Syntax
printerName = printing.EnumPrinters(index)
Parameter | Description |
---|---|
index | (Number) Zero-based index of the printer. Increment this value for each new EnumPrinters call |
Returns the string name of the next printer. An empty value means that enumeration is over.
Example
<!-- MeadCo Security Manager - using evaluation license -->
<object viewastext style="display:none"
classid="clsid:5445be81-b796-11d2-b931-002018654e2e"
codebase="smsx.cab#Version=8,3,0,4">
<param name="GUID" value="{3cfd70e2-f38f-4ab2-95f4-4ce4c1e39497}">
<param name="Path" value="sxlic.mlf">
<param name="Revision" value="0">
</object>
<!-- MeadCo ScriptX -->
<object id="factory" viewastext style="display:none"
classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814">
</object>
<p><small id='idOutput'></small></p>
<script defer>
function OutputHtml(html) {
idOutput.insertAdjacentHTML("BeforeEnd", html)
idOutput.scrollIntoView(false)
}
function EnumAll() {
OutputHtml("Default printer: " + factory.printing.DefaultPrinter() + "
")
for (i = 0; name = factory.printing.EnumPrinters(i); i++) {
OutputHtml("Printer: " + name + "
Job count: " + factory.printing.GetJobsCount(name) + "
")
var jobName = {}
for (j = 0; status = factory.printing.EnumJobs(name, j, jobName); j++)
OutputHtml("Job: " + jobName[0] + "Status: " + new Number(status).toString(16) + "
")
}
}
function window.onload() {
EnumAll()
}
</script>