4.4. Printing from iPad (AirPrint) via CUPS

IOS 4.2 allows Apple IOS devices (iPad, iPhone) to print using a new system called “AirPrint”. Currently this is only supported by a few select hardware manufacturers, Apple’s own printer simulator applications and printer sharing on Snow Leopard 10.6.5.

This document outlines how to configure CUPS and Avahi to allow printers to show up on IOS devices and allow printing to them. As a proof of concept cups-pdf was used to create a PDF of the printed document.

4.4.1. Requirements

4.4.2. Installation

Simple, just follow their instructions, or better yet just use your standard package management suite, as they are all included.

4.4.3. Configuration

Setup CUPS via the GUI, so you have defined a few printers, I created a cups-pdf printer to test with. The defaults for cups-pdf will be fine for testing. Prints end up in “/var/spool/cups-pdf/”.

Avahi, this may also require DBus (messagebus) to be installed, if you used a package manager then it should have been installed as a dependancy. Once you have a printer defined in CUPS you are ready to export it to IOS.

create a new file in “/etc/avahi/services” called “playprinter.service”, this file contains an XML description of the printer you wish to export via Bonjour. Below is my Sample file:

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
 <name>Play Printer</name>
<txt-record>ty=Play Printer</txt-record>
<txt-record>note=Super Space</txt-record>
<txt-record>product=virtual Printer</txt-record>

The things of note which the IOS devices are checking for are the “subtype”, which allows it to show up, and the “adminurl” and “rp” which tells IOS where to send the print job. The rest of this XML should be fairly similar to other Bonjour items.

You can use a “Bonjour Bowser” to see what is been broadcast on the network.

Restart avahi (Not always necessary), you should now be able to see your printer on your IOS device and send a print job to it.


the IOS device does not have a driver for the printer and never will, so CUPS will have to perform an driver and filter support necessary to get a nice print job. Refer to CUPS documentation for details of setting that side of it up.