Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cups #92

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Cups #92

wants to merge 10 commits into from

Conversation

vatsake
Copy link

@vatsake vatsake commented May 1, 2024

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 vatsake marked this pull request as draft May 2, 2024 16:47
@vatsake
Copy link
Author

vatsake commented May 3, 2024

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 vatsake marked this pull request as ready for review May 3, 2024 11:14
@fkoehl
Copy link

fkoehl commented Jun 11, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants