To clarify, this post reflects a specific use-case and most general end-users are better off with Printopia.
However, if you are like me, have a Linux server and share your printer through the network, you may be interested in what I have gathered in a few hours of learning and configuring, with much help from tjfontaine and fiorellonj’s posts.
With that out of the way, I shall now describe my set up. I have a Samsung CLP-300 printer connected to the AirPort Extreme Base station (acting as a Wifi to Ethernet bridge). My Linux server serves as the main router for the household and is always on. To begin with, I was able to print to my Samsung printer via Bonjour from both Macs and PCs. Ensure that Avahi is working properly.
Firstly, I upgraded my CUPS server to 1.4.5 as the 1.4 branch has better support for Bonjour. Then, add the follow line to the cupsd.conf:
ServerAlias *
Then, add the printer to CUPS so that the linux server can print directly to the Samsung printer. Ensure that the printer is shared and that the default settings are well adjusted, especially the colour and paper size options. Print a test-page to be sure.
Double check that the CUPS server settings are at least of the following:
Once that is out of the way, we now have to generate Bonjour/Avahi service entries that are compatible with iOS AirPrint. To do so, refer to the python script found in tjfontaine’s post. Place the generated Bonjour/Avahi service entries in /etc/avahi/services/.
To test, use a Bonjour browser to look for Internet Printing Protocol entries being advertised.
Finally, select print from the iOS dialogs and you will be able to see a list of printers:
A peculiarity of iOS AirPrint is that devices have no printing configuration. All printing is governed by the default configuration which is fine for most users. But in my case, I decided to offer 4 different types of print services (as seen in the screenshot above), in the hope to save toner and to offer more printing choices.
The other printing options are purely duplicates of the original printer with different default options applied.