/etc/avahi/services/myprinter.serviceadd
image/urfto the pdl section.
Add the file
/usr/share/cups/mime/apple.typeswhich contains:
image/urf urf (0,UNIRAST)
Add the file
/usr/share/cups/mime/local.convswhich contains:
image/urf application/vnd.cups-postscript 66 pdftops
(Thanks a lot to Panil for the information.)
(Below, the configuration for iOS 5.x)
Then here's what you need to do:
aptitude install avahi-daemonAnd to start the avahi daemon:
invoke-rc.d avahi-daemon restartNow the server is broadcasting avahi (Bonjour) information.
aptitude install avahi-discoverNow start avahi-discover (it is a GUI application) in a terminal/xterm
avahi-discover &In the Avahi Discovery GUI, click on the printer, and you'll see debugging output in your terminal/xterm. This output will help you to create the avahi service file below.
<?xml version="1.0" standalone='no'?> <!DOCTYPE service-group SYSTEM "avahi-service.dtd> <!-- This will allow to print on Mathilde through AirPrint from an iPhone/iPad --> <service-group> <name replace-wildcards="yes">AirPrint Mathilde @ %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>rp=printers/mathilde</txt-record> <txt-record>ty=Mathilde</txt-record> <txt-record>adminurl=http://cobra:631/printers/mathilde</txt-record> <txt-record>note=HP Laserjet 4000 2ème étage</txt-record> <txt-record>product=(GPL Ghostscript)</txt-record> <txt-record>printer-state=3</txt-record> <txt-record>printer-type=0x801046</txt-record> <txt-record>Transparent=T</txt-record> <txt-record>Binary=T</txt-record> <txt-record>Duplex=T</txt-record> <txt-record>Copies=T</txt-record> <txt-record>pdl=application/pdf,application/postscript,application/vnd.cups-raster,application/octet-stream,image/png</txt-record> <txt-record>URF=none</txt-record> </service> </service-group>You'll notice the printer will appear as "AirPrint Mathilde @ cobra" in Bonjour. (cobra is the Debian GNU/Linux server)
ServerAlias cobra.localWhy ? Because iOS (or MacOSX, too) doesn't like when you use a hostname which is not a fully qualified domain name. If you have your own domain name, well, you can refer to cobra as cobra.example.com, and use that name for CUPS and AirPrint But, in the case of my local network, I just use a short hostname. The solution is to append ".local" to the short hostname.
invoke-rc.d cups restart... and done, now your CUPS server is configured to allow AirPrint.
On your iPhone/iPad, touch any app that uses AirPrint (for instance, Safari), and touch "Print". You should see this:
... select the printer, and the number of copies, and you're done.
You'll notice that you didn't have to add printer in CUPS (you didn't change the /etc/cups/printers.conf file) and you had to change just one line in /etc/cups/cupsd.conf. Great, don't you think ? :)
This page has been visited times since its creation on July 24th 2012.
Last update: Tue Jul 24 20:00:00 CEST 2012