AirPrint and Ubuntu

This is what i did for my Canon MX850 to get AirPrint working on my Ubuntu system.

1. Have a Standard install of Ubuntu Desktop.
2. Go into the CUPS interface and make sure “Share published printers connected to this system” is enabled on the server settings.

3. Install avahi-daemon and make sure it is running.

4. Install avahi-discover and run it from a terminal. Click the printer you wish to duplicate. You should get something like:

[code]
Service Type: _ipp._tcp
Service Name: Canon MX850 @ Saturn
Domain Name: local
Interface: eth0 IPv4
Address: Saturn.local/10.0.0.4:30466
TXT Binary = T
TXT adminurl = http://Saturn:631/printers/Canon-MX850
TXT Duplex = T
TXT Copies = F
TXT Collate = F
TXT Sort = F
TXT priority = 0
TXT Fax = F
TXT rp = printers/Canon-MX850
TXT ty = Canon PIXMA iP5300 – CUPS+Gutenprint v5.2.6 Simplified
TXT Punch = F
TXT note = Saturn
TXT printer-state = 3
TXT txtvers = 1
TXT Transparent = T
TXT product = (Canon PIXMA iP5300)
TXT qtotal = 1
TXT Bind = F
TXT printer-type = 0xB01E
TXT Scan = F
TXT Color = T
TXT pdl = application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png
TXT Staple = F
[/code]

5. Create file name /etc/avahi/services/mx850.service.

6. Create an XML file similar to the example below, using the data above as the values.

[code]

< ?xml version="1.0" standalone=’no’?>
< !DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service -group>
<name replace-wildcards="yes">AirPrint MX850 @ %h</name>
</service><service>
<type>_ipp._tcp</type>
<subtype>_universal._sub._ipp._tcp</subtype>
<port>631</port>
<txt -record>txtvers=1</txt>
<txt -record>qtotal=1</txt>
<txt -record>rp=printers/Canon-MX850</txt>
<txt -record>ty=Canon PIXMA iP5300 – CUPS+Gutenprint v5.2.6 Simplified</txt>
<txt -record>note=Saturn</txt>
<txt -record>product=(Canon PIXMA iP5300)</txt>
<txt -record>printer-state=3</txt>
<txt -record>printer-type=0xB01E</txt>
<txt -record>Transparent=T</txt>
<txt -record>Binary=T</txt>
<txt -record>Duplex=T</txt>
<txt -record>Copies=F</txt>
<txt -record>pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png</txt>
<txt -record>URF=none</txt>
</service>

[/code]

7. Save the file. avahi-daemon should notice the new file and load it without a needed restart.

8. Add the following to /etc/cups/cupsd.conf near the top

[code]
ServerAlias *
Port 631
[/code]

9. Restart CUPS “/etc/init.d/cups restart”

10. On your iPhone/iPad, go into Safari, print, and search for printers. Your new printer should be in there.

—————————-

Update: as of June 28, AirPrint is built-in on Ubuntu 11.10.
1. On your computer start system-config-printer via System ->
Administration -> Printing (GNOME Classic) or via Turn-off-button at the
upper right -> System Settings -> Hardware -> Printing (Unity Natty) or
via the command line (all systems including Unity Oneiric).

2. In system-config-printer choose Server -> Settings and activate
“Published shared printers connected to this system”. Click OK and then
right-click on the icon of your print queue and choose Properties in the
pop-up menu. In the Policies section of the dialog make sure that
“Shared” is activated.

3. Make sure your mobile device is accessing your local network using
WLAN and then open an application with printing functionality on it
(like for example the browser or the photo viewer). Print something. The
print dialog should show your print queue and allow some basic settings.
Note that the Description/Info field and not the name of the queue is shown.

4. Check whether you get a correct printout.

Comments

24 responses to “AirPrint and Ubuntu”

  1. George Bennett Avatar
    George Bennett

    Hi…..thanks for putting this up. i am a noob in ubuntu and ipad and i tried to follow your instructions, but it didnt work. i was hoping you might be able to help a bit more.

    I am trying to get ipad to print on a hp 3030. here is the output when i run avahi-discover

    Service Type: _ipp._tcp
    Service Name: HP LaserJet 3030 @ eyn94eijms
    Domain Name: local
    Interface: wlan0 IPv4
    Address: eyn94eijms.local/192.168.1.3:30466
    TXT Binary = T
    TXT adminurl = http://eyn94eijms:631/printers/HP-LaserJet-3030
    TXT Duplex = T
    TXT Copies = F
    TXT Collate = F
    TXT Sort = F
    TXT priority = 0
    TXT Fax = F
    TXT rp = printers/HP-LaserJet-3030
    TXT ty = HP LaserJet 3030 Foomatic/Postscript
    TXT Punch = F
    TXT note =
    TXT printer-state = 3
    TXT txtvers = 1
    TXT Transparent = T
    TXT product = (HP LaserJet 3030)
    TXT qtotal = 1
    TXT Bind = F
    TXT printer-type = 0x80B016
    TXT Scan = F
    TXT Color = F
    TXT pdl = application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png
    TXT Staple = F

    and here is the xml file i created (using gedit), which is stored in /etc/avahi/services/HP-LaserJet-3030.service

    AirPrint HP-LaserJet-3030 @ %h

    _ipp._tcp
    _universal._sub._ipp._tcp
    631
    txtvers=1
    qtotal=1
    rp=printers/HP-LaserJet-3030
    ty=HP LaserJet 3030 – CUPS+Gutenprint v5.2.6 Simplified
    note=
    product=(HP LaserJet 3030)
    printer-state=3
    printer-type=0xB01E
    Transparent=T
    Binary=T
    Duplex=T
    Copies=F
    pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png
    URF=none

    can you help? thanks in advance

    my

    1. Peter Wong Avatar

      I have not tried this with a network printer but have you installed this as a printer locally so that you can print on the ubuntu machine?
      Also did you include the txt tags?
      the note tag should have eyn94eijms as the value

  2. George Bennett Avatar
    George Bennett

    Hi…..thanks for putting this up. i am a noob in ubuntu and ipad and i tried to follow your instructions, but it didnt work. i was hoping you might be able to help a bit more.

    I am trying to get ipad to print on a hp 3030. here is the output when i run avahi-discover

    Service Type: _ipp._tcp
    Service Name: HP LaserJet 3030 @ eyn94eijms
    Domain Name: local
    Interface: wlan0 IPv4
    Address: eyn94eijms.local/192.168.1.3:30466
    TXT Binary = T
    TXT adminurl = http://eyn94eijms:631/printers/HP-LaserJet-3030
    TXT Duplex = T
    TXT Copies = F
    TXT Collate = F
    TXT Sort = F
    TXT priority = 0
    TXT Fax = F
    TXT rp = printers/HP-LaserJet-3030
    TXT ty = HP LaserJet 3030 Foomatic/Postscript
    TXT Punch = F
    TXT note =
    TXT printer-state = 3
    TXT txtvers = 1
    TXT Transparent = T
    TXT product = (HP LaserJet 3030)
    TXT qtotal = 1
    TXT Bind = F
    TXT printer-type = 0x80B016
    TXT Scan = F
    TXT Color = F
    TXT pdl = application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png
    TXT Staple = F

    and here is the xml file i created (using gedit), which is stored in /etc/avahi/services/HP-LaserJet-3030.service

    AirPrint HP-LaserJet-3030 @ %h

    _ipp._tcp
    _universal._sub._ipp._tcp
    631
    txtvers=1
    qtotal=1
    rp=printers/HP-LaserJet-3030
    ty=HP LaserJet 3030 – CUPS+Gutenprint v5.2.6 Simplified
    note=
    product=(HP LaserJet 3030)
    printer-state=3
    printer-type=0xB01E
    Transparent=T
    Binary=T
    Duplex=T
    Copies=F
    pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png
    URF=none

    can you help? thanks in advance

    my

    1. Peter Wong Avatar

      I have not tried this with a network printer but have you installed this as a printer locally so that you can print on the ubuntu machine?
      Also did you include the txt tags?
      the note tag should have eyn94eijms as the value

  3. George Bennett Avatar
    George Bennett

    Thanks for responding, here is the new file (i used gedit and think it is an xml but do not know for sure since i am new to linux.

    AirPrint HP-LaserJet-3030 @ %h

    _ipp._tcp
    _universal._sub._ipp._tcp
    631
    txtvers=1
    qtotal=1
    rp=printers/HP-LaserJet-3030
    ty=HP LaserJet 3030 Foomatic/Postscript
    note=eyn94eijms
    product=(HP LaserJet 3030)
    printer-state=3
    printer-type=0x80B016
    Transparent=T
    Binary=T
    Duplex=T
    Copies=F
    pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png
    URF=none

    any ideas?

    1. Peter Wong Avatar

      Does your screen look like what I have in step 6 but with your values? Because the comments in wordpress doesn’t display the XML tags?
      Also have you tried plugging in the printer directly to the server? Or rebooting the ubuntu server? Or also could be a firewall issues that’s not allowing communication to the ubuntu server.

  4. George Bennett Avatar
    George Bennett

    Thanks for responding, here is the new file (i used gedit and think it is an xml but do not know for sure since i am new to linux.

    AirPrint HP-LaserJet-3030 @ %h

    _ipp._tcp
    _universal._sub._ipp._tcp
    631
    txtvers=1
    qtotal=1
    rp=printers/HP-LaserJet-3030
    ty=HP LaserJet 3030 Foomatic/Postscript
    note=eyn94eijms
    product=(HP LaserJet 3030)
    printer-state=3
    printer-type=0x80B016
    Transparent=T
    Binary=T
    Duplex=T
    Copies=F
    pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png
    URF=none

    any ideas?

    1. Peter Wong Avatar

      Does your screen look like what I have in step 6 but with your values? Because the comments in wordpress doesn’t display the XML tags?
      Also have you tried plugging in the printer directly to the server? Or rebooting the ubuntu server? Or also could be a firewall issues that’s not allowing communication to the ubuntu server.

  5. george bennett Avatar
    george bennett

    Thanks….the ipad seemed to see the printers. Just one last question…..does the ubuntu computer need to be on in order for the ipad to see the printers? thanks in advance

    1. Peter Wong Avatar

      Yes, The ubuntu machine is acting as your server so it would have to be on for you to print from your iPhone or iPad.

      1. george bennett Avatar
        george bennett

        Do you keep your ubuntu machine on all the time? Based upon your response, I was thinking of buying a cheap, used computer on ebay to put ubuntu on that could run all the time, i just dont know about the energy usage.

  6. george bennett Avatar
    george bennett

    Thanks….the ipad seemed to see the printers. Just one last question…..does the ubuntu computer need to be on in order for the ipad to see the printers? thanks in advance

    1. Peter Wong Avatar

      Yes, The ubuntu machine is acting as your server so it would have to be on for you to print from your iPhone or iPad.

      1. george bennett Avatar
        george bennett

        Do you keep your ubuntu machine on all the time? Based upon your response, I was thinking of buying a cheap, used computer on ebay to put ubuntu on that could run all the time, i just dont know about the energy usage.

  7. Peter Wong Avatar

    I’m using a old laptop as my AirPrint server and Web server, it only consumes 10-20 watts an hour.
    I also hear the Ubuntu 11.10 will soon support AirPrint built-in, it’s currently in beta stage.

  8. Peter Wong Avatar

    I’m using a old laptop as my AirPrint server and Web server, it only consumes 10-20 watts an hour.
    I also hear the Ubuntu 11.10 will soon support AirPrint built-in, it’s currently in beta stage.

  9. iuryribeiro Avatar

    Great article!!!

    I have done everything you said, my ipad and iphone find the remote printer connected to laptop however, when I click to print everything seems fine but it doesnt work.

    Could you help me?

    Regards,

    Iury

    1. Peter Wong Avatar

      Can you print within Ubuntu?

  10. iuryribeiro Avatar

    Great article!!!

    I have done everything you said, my ipad and iphone find the remote printer connected to laptop however, when I click to print everything seems fine but it doesnt work.

    Could you help me?

    Regards,

    Iury

    1. Peter Wong Avatar

      Can you print within Ubuntu?

  11. iuryribeiro Avatar

    Do I have to out these?

    Interface: eth1 IPv4
    Address: iury-linux.local/192.168.1.109:631

    1. Peter Wong Avatar

      Can print something inside of Ubuntu? And which version of Ubuntu are you using?

  12. iuryribeiro Avatar

    Do I have to out these?

    Interface: eth1 IPv4
    Address: iury-linux.local/192.168.1.109:631

    1. Peter Wong Avatar

      Can print something inside of Ubuntu? And which version of Ubuntu are you using?

Leave a Reply