Mike42\Escpos\PrintConnectors\CupsPrintConnector::__construct PHP Method

__construct() public method

Construct new CUPS print connector.
public __construct ( string $dest )
$dest string The CUPS printer name to print to. This must be loaded using a raw driver.
    public function __construct($dest)
    {
        $valid = $this->getLocalPrinters();
        if (count($valid) == 0) {
            throw new BadMethodCallException("You do not have any printers installed on " . "this system via CUPS. Check 'lpr -a'.");
        }
        if (array_search($dest, $valid, true) === false) {
            throw new BadMethodCallException("'{$dest}' is not a printer on this system. " . "Printers are: [" . implode(", ", $valid) . "]");
        }
        $this->buffer = array();
        $this->printerName = $dest;
    }