开发者

iPhone and printer integration Sample code/API for custom App development

My recent engagement demands a printer int开发者_StackOverflow社区egration using iPhone. The app will

• Generate a PDF with the collected data • Print the same when user clicks print button

I am fairly new in iPhone development. There are hardly any reference and sample codes to support the printing feature , however there are quite a few apps available in the market to print from iPhone!

Please help me with reference or sample code to realize the feature from within the custom app we are building.

Many Thanks -Jeet


I haven't developed an app that supports printing, however, I'm pretty sure the ones that do must be connecting to a companion OS X application running on some computer on the same wifi network that the iPhone app connects to and sends its data to.

This means that you'll have to look at the printing docs and sample code for the Desktop and build a helper app that will receive connections from your iPhone app. There is sample code to show you how to discover a computer on your network using Bonjour. You can then just stream the data over the network using a socket to the Desktop app from the iPhone and have it pass along the print job.

You say that you're fairly new to iPhone development, so this comes with a warning that it's not for the faint of heart.

Here is a blog post on how to communicate between desktop and iPhone using Bonjour:

http://cocoa-nut.de/?p=27

Best Regards,


There is official printing API from Apple. This only support for iOS 4.2 and above though:

http://developer.apple.com/library/ios/#documentation/2DDrawing/Conceptual/DrawingPrintingiOS/Printing/Printing.html


I am also looking for the same solution as I need to do this for the application that I am working on. I am also generating the PDF and user can then print it.

As you are saying that already developed apps are printing without using intermediate PC. But while searching over the net I came around an application which is useful for printing for Epson

http://mobile.eurosmartz.com/products/print.html

There it is mentioned by the company it self that "Install “Print” on your iPhone, download the free WePrint software for your desktop/laptop computer and then you can print directly from your iPhone."

Also there is another application on iTunes called "PrinterShare- print from iPhone to anywhere". There also they mentioned that computer connected to printer needs the PrinterShare software.

So I think there is a mediator present in these printings.

Let me know if you find some more information on this topic, as this is very new and clients are asking to avail this facility in there applications.

If you come to know any sample application

Regards, Vishal.


There is currently no Official printing API.

You could of course implement your own LPR printing code.

Or you can license a ready API from someone like www.e-workshop-dev.com

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜