views:

1010

answers:

4

Hi Friends,

My recent engagement demands a printer integration 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

+2  A: 

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,

Matt Long
A: 

MAtt,

Thanks for your note. However the apps developed by HP and the standard printing apps , such as 'Print & Share’, ‘Print’, ‘DocPrinter’, ‘NotePrinter’ using WiFi to print directly without using intermediate PC.

I am not sure if there is any standard protocol to share the file streams and printer prints that. Some of the bluetooth printer does, again iPhone bluetooth compatible printer is rare on this earth!

The app is meant for mobile workforce , therefore We are looking for an option to connect a printer directly - either using local Wifi or bluetooth preferably.

Thanks again.

Jeet
A: 

Hi Jeet,

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.

Vishal Mali
A: 

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

Peter Vogel