My Personal Blog

Just a spot for my random thoughts.

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




My Printer

_ipp._tcp
_universal._sub._ipp._tcp
631
txtver=1
qtotal=1
rp=printers/My-Printer-CUPS-Name
ty=My Printer
adminurl=http://198.168.1.4:631/printers/My-Printer-CUPS-Name
note=My Printer
priority=0
product=virtual Printer
printer-state=3
printer-type=0x801046
Transparent=T
Binary=T
Fax=F
Color=T
Duplex=T
Staple=F
Copies=T
Collate=F
Punch=F
Bind=F
Sort=F
Scan=F
pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/urf
URF=W8,SRGB24,CP1,RS600

 

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
zhound (16.02.2012 (23:13:34))
Yes No 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))
Yes No It did not work for me. I got ipad2 runing ios 5.0.1.
Any help?
Gravatar
Mathew (25.01.2012 (01:17:26))
Yes No 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))
Yes No Worked perfectly, took me approximately five minutes to set this up for myself. Thank you!!
Gravatar
Dave Hay (28.12.2011 (17:02:23))
Yes No 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))
Yes No
Thanks its work for my HP 1515n printer from both iphone and ipad.Boss is happy...............
Gravatar
loonix (04.11.2011 (13:35:32))
Yes No 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))
Yes No Perfect solution
Gravatar
Erik (10.09.2011 (05:18:35))
Yes No Ubuntu 9.04 - jaunty - Worked first time.

Followed the instructions exactly, the avahi daemon noticed the new file and loaded it, cupds does not know of ServerAlias (Unknown directive).

Prints to a Brother HL-5250DN laser.
Gravatar
Adam Bovan (01.09.2011 (15:51:17))
Yes No Great way around not using Airprint Printers, for me and a few others who have posted, its not the ideal situation as your pc/laptop needs to be on. For me an Airprint printer is the best solution.

Thank you for your contribution, i'll pass this on to my friend who doesn't have an Airprint Printer.

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

Antispam Refresh image Case sensitive