WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Howto: Enable airprint with cups/avahi  (Read 26246 times)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
Howto: Enable airprint with cups/avahi
« on: May 17, 2011, 03:30:24 AM »
If you have tc setup as a cups print server and you'd like to print from your ipod/iphone/ipad, read on.

Based on http://forums.linuxmint.com/viewtopic.php?f=42&t=60740

This assumes you already have tc/cups set up the share a printer - in addition, you'll need the pycups-2.7 and avahi-2.7 extensions. Note that pycups is only required to generate the avahi service file, you don't need it again after that.

1. Start the avahi-daemon and check using "avahi-browse -a -t" that it can see other network resources on your lan.

2. Cut and paste airprint-generate.py from https://github.com/tjfontaine/airprint-generate and make it executable.

3. Run airprint-generate.py and copy the avahi service xml file produced (AirPrint-OfficeJetG85.service in my case) to /usr/local/etc/avahi/services. In a few seconds, avahi-browse will show your printer being advertised on the lan:
Code: [Select]
$ avahi-browse -a -t
...
+   eth0 IPv4 AirPrint OfficeJetG85 @ tckayak              _ipp._tcp            local

4. Edit /usr/local/etc/cups/cupsd.conf and add "ServerAlias *" as follows:
Code: [Select]
Port 631
ServerAlias *
..restart the cups daemon

A few minutes later I was able to print over wifi from an iphone  :)
« Last Edit: May 17, 2011, 10:32:12 AM by Juanito »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
Re: Howto: Enable airprint with cups/avahi
« Reply #1 on: June 03, 2011, 09:39:50 AM »
Using tinycore as a cups printer server, an unexpected benefit from this is that this allows windows machines to use their local printer drivers rather than the cups printer drivers which seem to choke on complex images.

Download and install bonjour printer services for windows from http://support.apple.com/kb/DL999 and you will be able to see the airprint device and install the local drivers for it - something that would seem obvious, but is difficult to do in windows otherwise..

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
Re: Howto: Enable airprint with cups/avahi
« Reply #2 on: December 26, 2013, 09:03:18 AM »
an update for iOS > 6..

Edit your printer *service file in /usr/local/etc/avahi/services and add "image/urf" (without the quotes) in the pdl section

In older versions of cups more work is required in /usr/local/share/cups/mime, but cups-filters takes care of this in later versions.

Verified to work with iOS-7.0.4