/Printer-Portal

Easily add and remove printers.

Primary LanguageObjective-C

##Give your clients access to printers.

ATTN: This project is still in early development.

In a world of laptops the challenge of granting access to numerous printers in multiple locations for a myriad of clients can be daunting. Historically there have been a few ways to configure client computers to handle this.

  • Have some sort of shell script (i.e. .pkg postinstall) that will add all of the printers to the machine and then have the client to choose the right one in the print dialog. But when there are 10-20+ printers potentially available that can easily get confusing.

  • Manage with Active/Open Directory, but the syntax of configuring printers that way cumbersome, and prone mis-configuration. Additionally this technique is of no use when your clients aren't bound. Another issue is that it only shows the printers in the "Add Printers" dialog, and does nothing to help install the printers, and the list can be confusing when mixed with bonjour printers, or printers re-shared from local clients.

  • You could do it with puppet, munki on, casper, or configuration profiles, but again only if the clients are tied to the deployment, which may not always be the case.

  • Put up a help page with instructions on how to add the printers. LPD? IPP? Sockets? Ports?

###Enter Printer Portal ![](Printer Portal/StatusBarIcon32.png) Printer portal is a simple menu bar application that makes it easy for your clients to add and remove your institutions printers.

  1. Send your client a link to download and install the Printer Portal client.

  2. Send them a message with a clickable link such as this printerportal://your.server.com/printers/printerlist to the web host.

  3. Have the client choose the printer to add from the status menu item.

Server Configuration:

The recommended way is to use the companion Printer Portal Server, which is a small Django web app.

However if you're just interested in testing the client, you can provide the backing data in other ways.

  1. Serving a static Apple Property List formatted XML file.
  2. Generating JSON Data using existing host tools
    • The server must set an acceptable MIME type for the "Content-Type" header of the response. Either application/json, text/json or text/javascript
  • note: The Printer Portal client app will convert the "printerportal" string to "http" so to have requests directed to a secure server the scheme would be printerportals

Serialized Printer Keys:

  • Required

    • printer : The name for the printer.
    • host : IP address or FQDN for the CUPS server.
    • model : model name, use lpinfo -m to get an appropriate model string
    • protocol : currently acceptable options are ipp, ipps, lpd, http, https, socket
  • Optional

    • ppd : A url where a PPD can be download from a web server.
    • location: Location of the printer
    • description : Alternative discription for the user
    • options : Array strings of options conforming to lpoptions syntax, PrinterOpt=Value

Example XML File:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>printerList</key>
	<array>
		<dict>
			<key>printer</key>
				<string>main_printer</string>
			<key>protocol</key>
				<string>ipp</string>
			<key>host</key>
				<string>your.printserver.com</string>
			<key>description</key>
				<string>Main Printer</string>
			<key>location</key>
				<string>First Floor</string>
			<key>model</key>
			<string>Brother DCP-8250DN CUPS</string>
				<key>ppd</key>
			<string>http://your.server.com/ppd/bdcp-8250dn.gz</string>
		</dict>
		<dict>
			<key>description</key>
			<string>Another Printer</string>
			<key>location</key>
			<string>CMMN 332</string>
			<key>model</key>
			<string>HP LaserJet 4250</string>
			<key>ppd</key>
			<string>http://your.server.com/ppd/hplj.4250.gz</string>
			<key>printer</key>
			<string>comm_office</string>
			<key>protocol</key>
			<string>socket</string>
			<key>host</key>
			<string>192.168.2.1</string>
		</dict>
		<dict>
			<key>description</key>
			<string>Honcho's Printer</string>
			<key>location</key>
			<string>Boss's Office</string>
			<key>model</key>
			<string>HP LaserJet 4250</string>
			<key>printer</key>
			<string>boss_printer</string>
			<key>protocol</key>
			<string>lpd</string>
			<key>host</key>
			<string>192.168.2.101</string>
		</dict>
	</array>
</dict>
</plist>

Example JSON:

{
    "printerList": [
        {
            "name": "main_printer", 
            "description": "Main Printer", 
            "host": "pretendo.com", 
            "protocol": "ipp", 
            "location": "Living Room", 
            "model": "HP Color Laser Jet CP3525", 
            "ppd_file": null, 
            "options": [
                "TRAY_3=YES"
            ]
        }, 
        {
            "name": "bosss_printer", 
            "description": "Boss's Printer", 
            "host": "pretendo.com", 
            "protocol": "lpd", 
            "location": "Boss's Office", 
            "model": "HP 4250", 
            "ppd_file": null, 
            "options": []
        }
    ], 
}