Enable iOS AirPrint with any printer supported by CUPS
AirPrint is a wireless printing technology for iOS devices.
First we need to install some packages.
# apt-get install cups-pdf avahi-daemon python-cups cups-driver-gutenprint # apt-get install foomatic-db foomatic-db-engine foomatic-filters
If you have a HP printer you should also install hplip
# apt-get install hplip
Edit the CUPS' config file
after the line "Listen /var/run/cups/cups.sock" paste this
Listen IP-OF-YOUR-CUPS-SERVER:631 PreserveJobHistory No FileDevice Yes ServerAlias *
# Restrict access to the server... <Location /> Order allow,deny </Location> # Restrict access to the admin pages... <Location /admin> Order allow,deny </Location> # Restrict access to configuration files... <Location /admin/conf> AuthType Default Require user @SYSTEM Order allow,deny </Location>
# Restrict access to the server... <Location /> Order allow,deny allow @LOCAL </Location> # Restrict access to the admin pages... <Location /admin> Order allow,deny allow @LOCAL </Location> # Restrict access to configuration files... <Location /admin/conf> AuthType Basic Require user @SYSTEM Order allow,deny allow @LOCAL </Location>
Create new mime files - This is needed for iOS 6 to recognize CUPS print shares!
# echo "image/urf urf string(0,UNIRAST<00>)" > /usr/share/cups/mime/airprint.types # echo "image/urf application/pdf 100 pdftoraster" > /usr/share/cups/mime/airprint.convs
Open the local CUPS page in a web browser:
If you have a network printer (LAN,WiFi, JetDirect), turn it on. If your printer is USB only, connect it to your CUPS server.
login: root password: root's password
CUPS will start looking for your printer. Select it, click next, allow sharing, and click next again.
# /etc/init.d/avahi-daemon start # mkdir /opt/airprint # cd /opt/airprint # wget -O airprint-generate.py --no-check-certificate https://raw.github.com/tjfontaine/airprint-generate/master/airprint-generate.py # chmod +x airprint-generate.py # ./airprint-generate.py -d /etc/avahi/services # /etc/init.d/avahi-daemon restart # ls /etc/avahi/services/
You should see something like "AirPrint-Name-of-your-printer".
On the iOS side there's nothing you really need to configure.
The original howto which first appeared on the Arch Linux ARM wiki: http://archlinuxarm.org/support/guides/applications/cups-apple-airprint
factro said ...
Thank you sooo much...:D..it works
Raqel said ...
<comment date="2013-01-08T20:03:02Z" name="Raqel"> The developer reelesas of OS/X had support for exposing CUPS queues as AirPrint queues. Apple pulled that support. As near as anyone can tell there was no technical reason for that. So speculation is rampant that the removal was patent-related. </comment>
Lala said ...
<comment date="2013-01-09T06:49:02Z" name="Lala"> This is one of those things where you could keep aidndg to a list for days even though I'm quite happy with the current iOS.1) I think my number one is the multi-tasking system. Yes, we now have multi-tasking but it's a bit clunky. I want the ability to specify which Apps will stay in the background. I also want to be able to clear out everything easily, rather than have to stop each App individually. I also wants some fast way of switching Apps maybe a three finger swipe as has been rumoured.2) While I might not use it, the lack of a today screen is ridiculous.Bob </comment>
Luciano said ...
<comment date="2013-01-10T11:10:09Z" name="Luciano"> The purchases I make are etnierly based on these articles. </comment>
John said ...
<comment date="2013-02-07T01:49:52Z" name="John"> This works perfectly, however may I suggest at line:
"IP of cups server" or something similar
When I first saw it, I thought you meant IP of the printer! </comment>
srott said ...
<comment date="2013-02-08T18:09:47Z" name="srott"> I had to use Listen 0.0.0.0:631
because of dhcp
Rick said ...
<comment date="2013-02-10T19:19:45Z" name="Rick"> Hi and thank you for your guide. As John mentions the "IP-OF-YOUR-DEVICE" can easily be understood as IP of the printer...
Anyway, I got an issue. Even though I find the printer on my iPhone now I'm not getting anything printed.
All the best, Rick </comment>
YazzY said ...
<comment date="2013-02-11T09:35:49Z" name="YazzY" signature="YazzY"> Thanks. I changed that config line to IP-OF-YOUR-CUPS-SERVER which indeed makes more sense. </comment>