laravel-printing icon indicating copy to clipboard operation
laravel-printing copied to clipboard

Cups

Open vatsake opened this issue 1 year ago • 2 comments

1️⃣ Is this something that is wanted/needed? Did you create an issue / discussion about it first? Should solve #74, #81

2️⃣ Does it contain multiple, unrelated changes? Please separate the PRs out. Nope.

3️⃣ Does it include tests, if possible? (Not a deal-breaker, just a nice-to-have) Currently I modified the existing tests, will add more if needed.

4️⃣ Please include a thorough description of the improvement and reasons why it's useful. Removes the smalot/cups-ipp dependency.

5️⃣ Thanks for contributing! 🙌

Some side notes.

  • Currently there is no attribute filtering when querying for printers.
  • Currently you can only send 1 file/text per job. IPP actually allows multiple prints per job.
  • I couldn't test against a password protected cups server.

vatsake avatar May 01 '24 14:05 vatsake

It isn't the best API at the moment. Could be better. Custom page print-job example:

use Rawilk\Printing\Api\Cups\Types\Collection;
use Rawilk\Printing\Api\Cups\Types\Member;
use Rawilk\Printing\Api\Cups\Types\Primitive\Integer;
use Rawilk\Printing\Facades\Printing;

Printing::newPrintTask()
    ->printer('http://.../printers/...')
    ->content('hello world', 'text/plain')
    ->option(
        'media-col',
        new Collection([
            'media-size' => new Member(
                new Collection([
                    'x-dimension' => new Member(new Integer(9200)),
                    'y-dimension' => new Member(new Integer(1800)),
                ])
            ),
        ])
    )
    ->orientation('reverse-portrait')
    ->send();

vatsake avatar May 03 '24 11:05 vatsake

Thank you @vatsake, it fixes #74 for me!

@rawilk, will you consider approving this PR?

I'm willing to help to do some commits rebasing/polishing if needed.

fkoehl avatar Jun 11 '24 07:06 fkoehl