php-lpr/examples/print.php

17 lines
314 B
PHP

<?php
require_once __DIR__."/../vendor/autoload.php";
use NoccyLabs\Lpr\PrintJob;
$job = new PrintJob("image.png");
// Configure
$job->setPrinter("QL-570");
$job->setMedia("A4");
// Additional options can be set like this
$job->setOption("fit-to-page", true);
// Invoke lpr to print the image
$job->submit();