Koozali.org: home of the SME Server

Iphone Ipad Apple Airprint

Offline tec

  • **
  • 48
  • +0/-0
Iphone Ipad Apple Airprint
« on: March 05, 2011, 03:50:07 PM »
Hello together,
did anyone succeed to get Airprint to work with SME 7 or 8 Cups package working?
Cheers

Offline byte

  • *
  • 2,183
  • +2/-0
Re: Iphone Ipad Apple Airprint
« Reply #1 on: March 07, 2011, 12:16:16 PM »
I don't think it's even possible as AirPrint has very few hardware printers that support AirPrint and even using a Mac running Snow Leopard you need the bonjour service (and a couple of additional files) to simulate AirPrint which is what I currently do.
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline tec

  • **
  • 48
  • +0/-0
Re: Iphone Ipad Apple Airprint
« Reply #2 on: March 07, 2011, 01:01:29 PM »
Hi it is somehow possible as stated here:

http://www.finnie.org/2010/11/13/airprint-and-linux/

but until now i really didn't succeed to get it working under SME.

Cheers

Offline arnoldob

  • *
  • 183
  • +0/-0
Re: Iphone Ipad Apple Airprint
« Reply #3 on: April 25, 2011, 07:42:32 AM »
I've been trying to get the same thing working. I'd really prefer to use the SME CUPS install to handle printing duties since its always on and having another PC running just to handle printing via AirPrint seems wasteful. BTW there's lots of info in google to help get AirPrint working to any printer. If it can be done on my Win7 laptop, why not in CUPS? After all CUPS is what OSX uses.

I was stopped cold in the step 3, getting avahi-daemon running from the link posted by tec, copied below. It fails for dependencies that usually indicate some underlying fedora core stuff needs to be updated. Is there an alternative that will work on SME 7.5.1?

Looks like someone wrote some python scripts to use with avahi here:
http://www.atxconsulting.com/blog/tjfontaine/2010/11/21/automatically-generate-airprint-avahi-service-files-cups-printers
In case avahi becomes compatible in later SME releases.

This seems somewhat specific to debian:
1. Install CUPS and make sure it's actually working. Configuring CUPS correctly is outside the scope of this guide. You will need to have a PDF filter working correctly. Debian seems to provide this out of the box with a CUPS install; your mileage may vary.

2. Go into the CUPS interface and make sure "Share published printers connected to this system" is enabled.

3. Install avahi-daemon and make sure it is running. Restart CUPS to get it to publish printer services. (AirPrint will not be using the CUPS-published services, but we will need them to recreate a manual service.)

4. On another Linux box, install avahi-discover and run it from a terminal. Click the printer you wish to duplicate. Now switch back to the console and a set of debugging lines should be printed similar to this (I've added some linebreaks for readability):

Service data for service 'HP LaserJet 1200 @ nibbler.xn--n3h' of type '_ipp._tcp' in domain 'local' on 3.0:
    Host nibbler.local (10.9.8.1), port 631, TXT data: [
        'pdl=application/pdf,application/postscript,application/vnd.cups-raster,application/octet-stream,image/png',
        'Copies=T',
        'Duplex=T',
        'Binary=T',
        'Transparent=T',
        'printer-type=0x3056',
        'printer-state=3',
        'product=(GPL Ghostscript)',
        'note=Home',
        'ty=HP LaserJet Series PCL 4/5, 1.3',
        'rp=printers/hp1200',
        'qtotal=1',
        'txtvers=1'
    ]
5. Back on the server, create /etc/avahi/services/name.service. name can be anything; I named it /etc/avahi/services/hp1200.service in this case.

6. Create an XML file similar to the example below, using the data above as the values. Note that the data is in the opposite order of what avahi-discover gave it to you.

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">AirPrint hp1200 @ %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/hp1200</txt-record>
       <txt-record>ty=HP LaserJet Series PCL 4/5, 1.3</txt-record>
       <txt-record>note=Home</txt-record>
       <txt-record>product=(GPL Ghostscript)</txt-record>
       <txt-record>printer-state=3</txt-record>
       <txt-record>printer-type=0x3056</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>
The only differences are 1) I named the service "AirPrint hp1200" to not interfere with the "hp1200" service that CUPS publishes, and 2) the added "URF=none" record. And be sure to double check that "application/pdf" is included in the pdl record. If it's not there, don't simply try to add it, that won't work. You'll need to figure out why your CUPS installation doesn't have a PDF filter.

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

8. On your iPhone/iPad, go into an application (Safari, for example), print, and search for printers. Your new printer definition should be in there.
Tampa, FL USA