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

Connect to printer using URI - determine connection type from scheme #314

Closed
mike42 opened this issue Mar 9, 2017 · 3 comments
Closed
Milestone

Comments

@mike42
Copy link
Owner

mike42 commented Mar 9, 2017

Idea from #240 - write some new code in PrintConnector to accept a URI, then return different implementations based on the scheme used.

$foo = new PrintConnector::get("file:///dev/usb/lp0"); // FilePrintConnector
$foo = new PrintConnector::get("tcp://x.y.z.w:9100/"); // NetworkPrintConnector
$foo = new PrintConnector::get("ipp://foobar/"); // CupsPrintConnector
$foo = new PrintConnector::get("smb://windows/printer"); // creates a WindowsPrintConnector

This will facilitate storing a connection string in a database etc.

@mike42 mike42 changed the title URI print connector Connect to prinver using generic URI Mar 9, 2017
@mike42 mike42 changed the title Connect to prinver using generic URI Connect to prinver using URI - determine connection type from scheme Mar 9, 2017
@evsar3
Copy link

evsar3 commented Oct 3, 2017

@mike42 I made a new file called UriPrintConnector.php with it's class that implements exacly this. I'm not so good with git repositories so, I'm attaching the file then you can review and possible merge with the original project. Not tested with all protocols.

UriPrintConnector.zip

@evsar3
Copy link

evsar3 commented Oct 3, 2017

Usage:

$foo = UriPrintConnector::get("file:///dev/usb/lp0");
$foo = UriPrintConnector::get("file:///home/foo/bar.txt");
$foo = UriPrintConnector::get("tcp://127.0.0.1");
$foo = UriPrintConnector::get("tcp://127.0.0.1:8080");
$foo = UriPrintConnector::get("ipp://foobar");
$foo = UriPrintConnector::get("smb://windows/printer");
$foo = UriPrintConnector::get("usb://printer");
$foo = UriPrintConnector::get("com://COM1");
$foo = UriPrintConnector::get("ltp://LTP1");

@mike42 mike42 changed the title Connect to prinver using URI - determine connection type from scheme Connect to printer using URI - determine connection type from scheme Mar 12, 2018
mike42 added a commit that referenced this issue Mar 12, 2018
@mike42 mike42 added this to the 2.0 milestone Mar 12, 2018
This was referenced Mar 12, 2018
@mike42 mike42 closed this as completed Mar 13, 2018
@alvarobreton
Copy link

I want to handle it on an aws ec2 server, how can I connect a printer?
Ubuntu 20.04

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

No branches or pull requests

3 participants