I don't think you can 'switch off' a printer programmatically, unles you have a documented programming interface for this. Normally, these setting are configured via management consoles like HP Web JetAdmin for networked printers.
_________________________
There are two types of vessels, submarines and targets.