views:

139

answers:

3

Is there a way to send a print request to a printer using wifi or some other means?

Edit: There must be, because there are some applications which lets you do that. But how do they do it? For example,

  • HP iPrint Photo
  • Air Photo
  • EuroSmartzPrint

and maybe others as well.

+1  A: 

As far as I know it is only possible if the devices are Bonjour-enabled as part of the Made For iPod program. Then you can use EAAccessoryManager and related classes to make a connection and send data to the device. This is one of the harder things you can attempt on an iPhone...

Here's another (perhaps) useful question on the subject.

Adam Eberbach
Thanks for sharing a useful link.
Mustafa
+2  A: 

Yes, you can certainly find printers nearby using Bonjour and the NSNetServiceBrowser class. Specifically you'd want to send its searchForServicesOfType: message, with a type of @"_ipp._tcp" (nearby printers). Check out the Browsing for Services article in the developer documentation. How the actual spooling to print works is beyond me. I'm just learning GameKit/Bonjour right now.

Typeoneerror
I was hopping to find a third party library for this. Looks like i'll have to do a lot of work to get this done. Thank you for your help.
Mustafa
+5  A: 

There's no native way to print in Apple's SDK. Air Photo prints using a helper app installed on a computer, so it sends the request to the desktop app which actually sends the print request. HP's app can connect to HP printers that it can find on the network, presumably using Bonjour. The difficulty with printing directly is getting the right drivers, fortunately for HP, they make the printers too. EuroSmartz I believe does both previous methods, but they make no claim as to how good the quality will actually be printing directly to the printer, probably because they can't include vendor supplied drivers.

So, if you want to print your options are:

  1. Connect to the printer via Bonjour and attempt to print without vendor supplied drivers (maybe you can find open source ones).
  2. Write a desktop app to assist in printing. (Better quality, but requires a middle man.)

Update: With iOS 4.2, Apple is including a new technology called "AirPrint". Apple is essentially doing both #1, by printing directly to HP printers that support ePrint (my understanding is that this doesn't use drivers in the traditional sense), and #2 by printing via a Mac with OS X 10.6.5.

Cory Kilger
Thanks, appreciated.
Mustafa