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

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!

Related

Create an iPad app that can send/receive data via the USB cable?

I want to create an iPad app that connects to another machine, laptop or otherwise, via USB and communicates to some other application I develop running there.
I know that this is easy to achieve via Bluetooth or WiFi but this particular set of solutions must be done via a USB cable.
Is it possible to do so without access to the Apple MFi program? (I am about 5 weeks in and the response is not looking good).
iOS App --> USB Cable --> Mac OSX --> Desktop App (without MFi access)
Thanks
To use USB communication Apple does not provide any API within IOS SDK. The only option right now is MFI. I don't think Apple will allow this in near future.
To use serial communication, you need MFI as you may have discovered. However, there is a poor man's way of achieving this. I have done so during development.
Enable "Internet sharing" on your device and connect to it. Use "ifconfig" on your Mac to find out the interface to use. You do not need to use this as the default connection, but it needs to be active. If I remember correctly, only one end can initiate connections (it was a while so I am sorry that I don't remember the details).
EDIT: I would also like to point out that I did this on an iPhone, not an iPad.
Not over USB but over RS232 (serial port)
Look here: http://www.redpark.com/c2db9.html
But:
The cable uses the old 30 pin connector, but according to them it's compatible with the Lightning adapter
The application won't be accepted on the AppStore, it's for internal use only.
There is a (small) book that explains how to use this cable to connect an iPhone directly to an Arduino, it's been published in late 2011. "iOS Sensor Apps with Arduino Wiring the iPhone and iPad into the Internet of Things" http://shop.oreilly.com/product/0636920021179.do

iOS Bluetooth printer?

Does anybody suggest a mobile printer able to print receipt with a good SDK to interface wireless an iOS application adhoc developed ? The printer should be small and should use rechargeable batteries for field use.
I cannot use wifi because not always a trusted access point (customer premises) is available, so I think to use Bluetooth, but of course any suggestion is welcome !
FYI I already checked Zebra printers SDK for iOS but it seems able to print only using a TCP/IP address, it means (for as I know) I should use wifi. In my case the application should be used in the field from an iPad connected with cellular network. In iPad there is no hot-spot and not always there is an available wifi access point tho connect the iPad and the printer the the same network to use TCP/IP addresses. That is the reason I'm guessing the last chance should be bluetooth.
Unfortunately iOS5 does not support Bluetooth printing.
http://support.apple.com/kb/ht3647
Have you considered VPN via WEP to a network printer?
Alternatively some printers can be set up with their own email address. PDF attachments can be sent via this address to be printed. These emails can be sent encrypted.
I know that this isn't the IDEAL answer, but it is likely to work for the time being until iOS is properly updated.
Yes, I have Bluetooth printer for IOS device, it is Apple MFI approved
see details from this URL http://www.bluebamboo.com/other_file/P25i%20Datasheet%20%28EN%29%20v1.0%2009-Oct-2011.pdf
I know you already accepted an answer, but here's another one: have the technician bring their own wireless base station (AirPort Express perhaps) and create his own wireless network (that won't have internet access, but that's not needed) with appropriate security. Then you can use any HP wireless capable printer and have the iOS device and the printer connect to the wifi network created by the wireless access point (which should be set with DHCP to vend IP addresses in a non-routable range like 192.168.x.x, obviously).
We also have a Bluetooth printer that is MFI certified along with an easy to understand iOS SDK. Please take a look at the EZPay App on the Appstore. The app's currently in Japanese (fir one of our clients) but the description explain a little about the printer. I'm currently traveling at the moment, but if you shoot me an email from the contact info on the App Store. I can get a few other things out to you. Cheers... B
No need to develop a full blown SDK, check out Mobi Print. it has the Zebra sdk already implemented and connects to any webservice or ODBC database. It also has stored label/receipt formats in there app so just upload your format and should be good to go.
here is link for Mobi Print

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

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:
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.

iPhone interaction between PC app and iPhone app using USB

I know since the 3.0 SDK we can use accessories, so my question is simple, what is the process to make an iPhone app and PC (or Mac) app interact, using the USB ?
I don't ask you any code, but just the paths and the keys for making that work.
Have I to access the iPhone disk through SSH and work with files ?
Or can I send data from the iPhone app and intercept (get) it on the PC app (and send data from PC to iPhone) ?
Thanks, and if this question is stupid, just tell me, I didn't find on Dev Center (I don't really know what I have to looking for...) !
Edit : I read some news from Microids, they will synchronize PC and iPhone games (i.g here), and somewhere (I can't find it again) they say connecting the iPhone on the USB, so I think this is possible
USB access on the phone is only supported via the External Accessory Framework. You cannot hook the iPhone up to arbitrary USB devices, the devices actually have to support the EA protocol. You can get more details about it via the Made for iPhone program.
Other than that there is no USB access available on to applications.
You want the External Accessory Framework. Having said that, I'm not sure that Apple's intention was for you to communicate with an application on a PC/Mac. It's really for talking to accessories such as iPod docks, remote controls, etc. Apple may not allow an application that talks to a PC in this manner in the App Store.
You might be interested in ssh_relay (earlier called iphone_tunnel).
There is a /System/Library/Lockdown/Services.plist on your iPhone and you can start any such services via AMDeviceStartService and then communicate with it.
The ssh_relay demonstrates how to do that by having a simple port forwarder as a service on the iPhone site and the client application on your PC, so you can forward any local iPhone port to your PC. This is not exactly what you wants here (it is handy in the case you have already another service running on the iPhone which communicates via simple TCP and you want to access that; for example SSH) but based on this example, it should be straight-forward to have any communication between the service (in Services.plist) and your PC.