Sending print request from with-in an iPhone application - iphone

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.

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:
Connect to the printer via Bonjour and attempt to print without vendor supplied drivers (maybe you can find open source ones).
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.

Related

Remote Access of iPhone

I am new to remote access programming, please dont feel bad to place this question here. I didn't get a beginning yet after a long search.
I heard iPhone can be used as remote for cars, electric devices and even accessing iPhone from another iPhone. Which library should I use for remote access? Any tutorial available?
Take a look at the External Accessory Framework. This framework allows you to communicate with "connected devices" (either through bluetooth, or via a physical connection).
If you want anything a bit more complicated you're probably going to have to set one device up as a server and the other as a client and have the two communicate as such.
Another way you could do it is to use an XMPP (aka Jabber) central server and set the two devices up as clients which can push messages to each other to control each other.

How to create a Mac/PC server app that interacts with iPhone/iPad App?

Can someone please point me in the right direction to create a Mac/PC server app that runs in the background and connects to an iPad app over the local WiFi network?
No matter how I phrase a search on Google it just brings up various apps like Remote Mouse and whatnot and no tutorials or even a hint of where to start.
I just need to send simple commands from iPad to computer over local wifi. A point in the right direction and I can likely fill in the blanks.
Thank you.
Thomas
EDIT: I am using web languages for the iPad version that I will build as a native app using open source tools.
OK, then. It actually depends on what you really need. I made the assumption you need real-time and perhaps binary data transfer.
Your best bet is to write your server application using standard C or C++ so it compiles on both as simply as possible.
If you want to avoid all the burden of writing a protocol for service discovery or asking users to enter the ip address of your server you will use a mDNS implementation for your server and your iPhone app.
If I were you I would try bonjour: http://www.apple.com/support/bonjour/
on iPhone You could start here: http://developer.apple.com/library/mac/#documentation/Networking/Conceptual/NSNetServiceProgGuide/Articles/PublishingServices.html
Once you have your sockets you will have to implement a networking protocol between your server application and your iPhone app.
You will have to be careful about byte ordering and little subtle problems with latency, disconnections and other problems inherent to networking and WiFi.
In windows you will want to register your application as a service and in Mac OS X/UNIX you'll probably want to deamonize it.
Good luck!

Need help in writing a Receipt Printer driver for the Epson POS TM-T88 on iOS devices(iPhone, iPad)?

I write an native application for an iOS devices(iPhone and iPad) and want to print to Receipt Printer Epson TM-T88. I can not find any information on how to write a driver for Receipt Printer on iOS devices. Pleas can some one help me out or point out where even to start, thank you all.
Epson provides SDKs for iOS, which should be sufficient in connecting to their printers.
http://pos.epson.com/mobilesdks/index.htm
I don't believe the T88 is supported unless you have the Ethernet module to give the printer a TCP/IP connection as I believe that is the only way to print through iOS.
The target printer needs to be "AirPrint" capable. Currently, only a handful of HP printers are capable. I recommend you looking into solutions similar to Printopia.
I need to do this too but this is all I can find on StackOveflow:
Printing to Epson TM-T88V receipt printer from iOS/iPad using CUPS or other framework
Why can I not receive a response from a TCP/IP capable printer?
printing from ipad to receipt printer(Epson TM-T88v) thr wifi
The 3rd post mentions signing up with Epson Expert to gain access to technical docs etc. The TM-T88 Technical Reference Guide states:
With ESC/POS commands, you can
directly control all the TM printer functions, but detailed knowledge of printer specifications or
combination of commands is required, compared to using a driver.
To use ESC/POS commands, you need to agree to a nondisclosure contract first and obtain the
ESC/POS Application Programming Guide. Ask your dealer for details.
It also says this about the TM-T88V Mac Printer Driver:
Mac printer driver allows you to control the TM-T88V using Common
UNIX Printing System (CUPS) on Mac OS X.
This MacWorld forum post contains a lot of information about IOS printing via CUPS:
http://hints.macworld.com/article.php?story=20101027080807322

How to access any printer present in wifi network in an iPhone application?

I want to develop an iPhone application where i want to access any printer present in my wifi network.
But according to Apple :" Printing is not supported because there is no direct support for connecting printers or other print-related hardware to an iPhone or iPod touch".
But there are many application in appstore which is providing this facility.
So Is it possible to access any printer present in my wifi network and print any PDF/Any file.
If yes then how?
Is there any API available for this?
There is no current API for this.
What those applications do is implement the raw functionality - ie. the HP app for printing to HP printers opens a raw socket connection to the printer and converts the document to be printed into the raw format for the printer. So it may be converting the PDF document into PCL for example. There is no iphone API for PCL, so you would have to read the PCL specification and learn how to generate it "by hand", or find a library from another platform you can port onto the iphone.
The problem is, there are a large number of printers, some speak PCL, some speak postscript, some speak custom languages - it is a large task to implement them all.
Some of the apps in the appstore rely on you having a PC, and they install a piece of software on the PC - effectively all these are is a frontend to send the document to the PC to be printed, using the printer drivers already present on the PC.
Apple have stated that they will be releasing printing for the ipad - ipad printer support confirmed by Steve Jobs. Presumably that will involve an API other apps can use, and it seems likely that will eventually come to the iphone too.
Here's one of the apps you mention:
http://mobile.eurosmartz.com/faqs/faqs_index.html
You can print direct to most WiFi printers or installing by the WePrint helper software on your Mac or PC you can print to any printer connected to your computer via USB cable, network, WiFi, BlueTooth or other means.
So the PC will have a custom bit of software which will print documents to an attached printer, and the iPhone must communicate with said PC software and transmit the required document.
Hope that helps!

How mobile printer that work alone and with WIFI for POS app?

I'm hunting for a mobile POS printer for use in a mobile point-of-sale application (BestSeller). The requeriments is that must work independent of anything except the mobile device. So the solution is only: Printer + iPhone.
I have a early question on this, here but with not answers.
The idea is that the printer work as their own server and I can send print commands to make tickets and that stuff.
The salesman work outside the company,and have not ascces to internet or other facilities.
I found this:
http://www.barcodegiant.com/epson/mobilink.htm
and
http://www.barcodegiant.com/zebra/mz220.htm
but is not clear to me if will work as I imagine. And also, I don't find any how to in how make the programing...
You should probably just send your salesmen with laptops and printers as that solution is easy and well supported. I don't know of any solutions currently that would allow you to connect an iPhone directly to a printer or to print to a printer with wifi. Printing solutions currently available require some sort of desktop or server app counterpart to facilitate the actual printing.