开发者

Sending print request from with-in an iPhone application

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

Edit: Ther开发者_如何学Pythone 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.


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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜