AirPrint on Linux with iOS 6

For those of you that have upgraded to iOS 6, you may have discovered that my AirPrint tutorial no longer works. This results from the fact that URF is the required format, and the PDF container relied on previously cannot render pages from an iOS 6 device. To fix this you need to compile the urftopdf filter for CUPS and modify your AVAHI configuration accordingly.

Let me preface this by saying these instructions assume Ubuntu Server. Additionally, unlike my previous instructions this does require development tools and a little bit more hacking.

1. Install Pre-Requisits. You are going to need to compile a filter for CUPS; to do this the libcups library is required. Unfortunately, this cannot currently be installed directly using the CUPS development libraries for Ubuntu as a result of a downstream dependency error. However, the Linux Standard Base (LSB) libraries will include this for you:

apt-get install build-essential
apt-get install lsb-build-base3

After installing, you will need to fake out the cups include directory:

$ cd /usr/include
$ ln -s lsb3/cups .

Finally, the library version is currently at 2 which requires another tweak so that we can link directly:

$ cd /usr/local/bin/
$ ln -s

2. Install libHaru. This is a PDF library and can be downloaded from It can be easily compiled and installed on Ubuntu, you may cut and paste the following and execute at a command prompt:

$ wget
$ tar zxvf libharu-2.2.1.tar.gz
$ cd libharu-2.2.1/
$ ./configure && make
$ sudo make install

3. Download urftopdf and compile. This is the most critical part, and is contingent on the previous steps. You can find this on GitHub at or you may refer to the following:

$ git clone
$ cd urftopdf
$ make
$ sudo ./

During the build process, pay particular attention to the output of make. Since there is no standard configuration script, any kind of build failure presents itself here; this is a typical result of compiling urftopdf on an x86_64 Ubuntu server with Linux kernel 2.6.32:

$ make
cc urftopdf.c -lhpdf -lcups -o urftopdf -lm
urftopdf.c: In function ‘main’:
urftopdf.c:327: warning: comparison between pointer and integer

4. Update URF Text Record in AVAHI Printer Configuration. In your AVAHI printer configuration file(s), either update or add the following <txt-record/>


In most cases, your AVAHI printer definitions can be found in /etc/avahi/services.

5. Update MIME Type in AVAHI Printer Configuration. Within the same printer configuration file(s), ensure the following record exists with these MIME types:


6. Restart CUPS and AVAHI.

That should do it. From your iOS 6 device the printers on your Linux server will be visible and you can once again print. As previously noted, this has the added benefit that the AirPrint devices can also be shared with your Mac OS X computers.


15 thoughts on “AirPrint on Linux with iOS 6

  1. Hi! I tried to run your code, but I get this as a result of make =

    /usr/bin/ld: cannot find -lcups
    collect2: error: ld returned 1 exit status
    make: *** [urftopdf] Error 1

    Can you help me? many thanks in advance!

    • I had replied to this previously, but it looks like it didn\’t make it. Here goes again…

      It’s trying to link to the cups library but it’s not there. The lsb-build-base should include this but if you’re on an older version of Ubuntu you may want to try:

        sudo apt-get install libcups2-dev

      Let me know if that works. Also, be sure to follow my other steps from the previous write-up on AirPrint with iOS5 devices.

  2. Thank you!
    Finally your post help me setting up cups with airprint-option on a raspberrypi (running raspbian – debian wheezy), though in my special case adjusting the avahi configuration as you described it and installing libharu did it (urftopdf wasn\’t necessary).

    • This should work with with anything from iOS 4.2 onwards; which would cover any iPad or just about iPhone from 3GS on up.

    • Yes – this works with iOS7. The latest version of netatalk does generally make all of this much easier to setup. I am currently running v3.0.4 and am extremely pleased with all aspects of this, including print and TimeMachine support on Linux.

      • Many thanks for your response.

        Today I finally had time to connect my HP Deskjet 990C to my Ubuntu box. The printer got recognised and via the GUI I selected to share and announce the printer. Printing from my MacBook was never so simple, in the add printer dialog the printer was visible (via bonjour). Double clicking it was enough to make it work.

        Then I tried printing from my Iphone 4s running IOS 7. Also there the printer was seen. I didn\’t expect it to work, since I didn\’t any filters and such yet. But it does work. First I tried to print a mail, then I also tried to print a photo. Both where printed nicely.

        Running Ubuntu 12.04.3 LTS.

        • That\’s good to know, I should probably update my site to reflect the excellent support v3 is offering. Configuration is much easier than before, and the need for much of these manual tweaks has gone away.

  3. Fantastic! Thanks for putting this together. FYI I was able to get it running on CentOS 5 and OpenBSD 5.4 as well.

  4. These directions don\’t seem to entirely work with Ubuntu 14.04 for me.

    Specifically Steps 4 and 5.

    The directory /etc/avahi/services exists but there is nothing there to edit so I\’m not entirely sure what I should be doing!

    • Check out my other article on Netatalk 3.0, you\’ll probably just need to update /etc/afp.conf to configure your AFP server. Everything goes in here now, the services used in previous releases will rollup into this fie.

Comments are closed.