HomeBlogAirPrint with Ubuntu 10.10

my random thoughts

take 'em or leave 'em

AirPrint with Ubuntu 10.10

HomePrintE-mailPdf

 I just upgraded my iPad to iOS 4.2.1.  As most have figured out by now, AirPrint is not available for printers outside of the chosen few HP printers.  So, of course I set out to find a way to make it happen with my Samsung multifunction printer.  To my delight, Ubuntu comes with all you need pretty much out of the box.  All I had to do was create a printer service file for avahi, make a couple changes to CUPS config, then restart cups and BAM, I'm printing from my iPad.

Okay, so here are the details.  This of course assumes that you already have an installed and functioning printer within Ubuntu.

First, let's create the service file for avahi.

sudo pico /etc/avahi/services/printer.service

Insert the following into the file and save by holding the control key then hit O

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
  <name>My Printer</name>
  <service>
    <type>_ipp._tcp</type>
    <subtype>_universal._sub._ipp._tcp</subtype>
    <port>631</port>
    <txt-record>txtver=1</txt-record>
    <txt-record>qtotal=1</txt-record>
    <txt-record>rp=printers/My-Printer-CUPS-Name</txt-record>
    <txt-record>ty=My Printer</txt-record>
    <txt-record>adminurl=http://198.168.1.4:631/printers/My-Printer-CUPS-Name</txt-record>
    <txt-record>note=My Printer</txt-record>
    <txt-record>priority=0</txt-record>
    <txt-record>product=virtual Printer</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>Fax=F</txt-record>
    <txt-record>Color=T</txt-record>
    <txt-record>Duplex=T</txt-record>
    <txt-record>Staple=F</txt-record>
    <txt-record>Copies=T</txt-record>
    <txt-record>Collate=F</txt-record>
    <txt-record>Punch=F</txt-record>
    <txt-record>Bind=F</txt-record>
    <txt-record>Sort=F</txt-record>
    <txt-record>Scan=F</txt-record>
    <txt-record>pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/urf</txt-record>
    <txt-record>URF=W8,SRGB24,CP1,RS600</txt-record>
  </service>
</service-group>
  

 

The things to change are in red. My Printer can be anything you want.  My-Printer-CUPS-Name has to be the name CUPS has assigned to the printer.  You can obtain this by going to System -> Administration -> Printing or browsing to CUPS web admin.  In  Ubuntu's printer manager, it will be whatever is listed underneath the printer image.  The IP address in the adminurl should be the IP of the computer that has the printer installed.  

Of course you can change the options such as Duplex, etc based on your printers features.

Now, you need to change a couple things with CUPS config.

sudo pico /etc/cups/cupsd.conf

Make sure you have the following:

ServerAlias *
Port 631
Listen /var/run/cups/cups.sock

 

Now go back to System -> Administration -> Printing and click Server -> Settings.  Make sure "Publish shared printers connected to this system" is checked.  Click OK.  Restart the CUPS server.

sudo /etc/init.d/cups restart

You should now be able to print from the iPad!




Gravatar
Kintaro (21.04.2012 (08:13:28))
works like a charm!!!

thank you
Gravatar
Michael (15.04.2012 (00:10:53))
Awesome and then some! Worked like a charm. Thanks!
Gravatar
zhound (16.02.2012 (23:13:34))
I just intalled ubuntu 11.10 with all my printers. Avahi-daemon did not automatically advertise the printers. I had to generate the service files. Now avahi-discover can see the printers, but the iOS devices still can't see them. Am I missing something?
Gravatar
Iury (14.02.2012 (22:01:22))
It did not work for me. I got ipad2 runing ios 5.0.1.
Any help?
Gravatar
Mathew (25.01.2012 (01:17:26))
Hi,

Thanks for the this tutorial. All printing worked from iPhone & iPad but only thing is it takes about 2-4 minute to print unlike printing via samba. Other than this printing delay, printing is fine.


Does anybody know a setting to improve this?

Thanks

Mathew
Gravatar
Adam Monsen (01.01.2012 (21:08:23))
Worked perfectly, took me approximately five minutes to set this up for myself. Thank you!!
Gravatar
Dave Hay (28.12.2011 (17:02:23))
laugh

Excellent tip, works like a dream. Have blogged my own experiences here -> http://portal2portal.blogspot.com/2011/12/printing-from-ipad-2.html
Gravatar
atif (14.12.2011 (05:22:10))

Thanks its work for my HP 1515n printer from both iphone and ipad.Boss is happy...............
Gravatar
loonix (04.11.2011 (13:35:32))
Hi:

Thanks for the tutorial. I got it working for the most part - I can print from my iphone but the text that is being printed is illegible ie. instead of the proper text it shows mixed up letter and symbols...

Any ideas?

Thanks

AR
Gravatar
Philarete (01.10.2011 (20:35:38))
Perfect solution

Page 1 of 4

Smileys

:confused::cool::cry::laugh::lol::normal::blush::rolleyes::sad::shocked::sick::sleeping::smile::surprised::tongue::unsure::whistle::wink:

 1000 Characters left