[cups] How to enable AirPrint in CUPS

Nicolas Schmidt schmidtn at math.hu-berlin.de
Fri Oct 16 08:34:00 PDT 2015


Setting up AirPrint with CUPS shouldn’t be too hard. The steps will of course in part depend on the OS you’re on, but here’s how I did it on a freshly installed OpenBSD 5.7 machine.


1. Set up the Avahi Daemon to start on boot

The avahi daemon implements the mDNS-SD service which advertises the CUPS IPP printers. It was already installed on my virgin OpenBSD machine, so all I had to do was add „avahi_daemon“ to my /etc/rc.conf.local so as to read:

pkg_scripts = dbus_daemon avahi_daemon cupsd


2. Tell the Avahi Daemon to advertise your IPP printer

Basically all you need to do is to create a text file in /etc/avahi/services/ describing the printer. In my case I have a file AirPrint-lp0.service with the following content:

<?xml version="1.0" ?>
<!DOCTYPE service-group  SYSTEM 'avahi-service.dtd'>

<service-group>
<name replace-wildcards="yes">AirPrint lp0 @ %h</name>

<service>
<type>_ipp._tcp</type>
<subtype>_universal._sub._ipp._tcp</subtype>
<port>631</port>
<txt-record>txtvers=1</txt-record>
<txt-record>qtotal=1</txt-record>
<txt-record>Transparent=T</txt-record>
<txt-record>URF=none</txt-record>
<txt-record>rp=printers/lp0</txt-record>
<txt-record>note=Kyocera FS-1300D</txt-record>
<txt-record>product=(GPL Ghostscript)</txt-record>
<txt-record>printer-state=3</txt-record>
<txt-record>printer-type=0x809054</txt-record>
<txt-record>pdl=application/octet-stream,application/pdf,application/postscript,application/vnd.cups-raster,image/gif,image/jpeg,image/png,image/tiff,image/urf,text/html,text/plain,application/vnd.adobe-reader-postscript,application/vnd.cups-command</txt-record>
</service>
</service-group>

Some of these option are self-explanatory, which some others are a bit esoteric. For this reason there is a handy python script that can produce such a file for you automatically. The script is available here

https://github.com/tjfontaine/airprint-generate

3. Reboot (or alternatively just start avahi_daemon by hand)

Now you should see your printer in your iOS devices. Regarding what Michael said, I think he refers to the fact that AirPrint is actually a modified version of IPP, so what your iOS device thinks is an AirPrint printer is actually not. So strictly speaking CUPS „does not support AirPrint". However for me it just works.

Best,
Nicolas A. Schmidt

> Am 15.10.2015 um 21:55 schrieb Brian Corbin <brian.corbin at ibethel.org>:
> 
> We are running CUPS 2.1.0 running on OS X 10.11.  We are a big organization that has a lot of printers to share and it’s working great with CUPS.  The only thing we can’t figure out is how to enable AirPrint in CUPS so that all our iOS devices can see the printers being shared on our CUPS server.  We have a lot of iOS devices and they would like to be able to print to all our printers.  Any help in this process of how to enable this functionality in CUPS would be awesome!
> Thanks!
> Brian
> _______________________________________________
> cups mailing list
> cups at cups.org
> https://www.cups.org/mailman/listinfo/cups




More information about the cups mailing list