Wednesday, April 7, 2010

iPhone Printing using MonoTouch - Proof of concept

Printing from the iPhone (also iPad I presume) it's not an impossible task (as it is in WP7 for the moment). It can be done using a network printer connected to the device using wireless radio (infrastructure or Ad hoc mode). As there is no internal driver for printing developers will have to write an interface to the printer. The "task" is pretty big as there are many programming languages for printers: HP PCL5, Epson ESC/P, PostScript, Zebra Programming Language, ASCII printers and many more. Using socket programing available in MonoTouch it is possible to communicate/print to any network printer, but it would be easier to have a "unified" interface like the ones available on WinCE (PrinterCE, PrintCE), libraries that can be
ported to the iPhone.
The attached sample it's not simple line printing but implements a small part of the PCL5 interface. It will print two boxes and some text on any PCL5 compatible network printer (if you have such a printer you can try it). The only two parameters required are the IP of the printer and the port used for communication (usually 9100).
Let's hope that soon we will see PrinterTouch or PrintTouch library :). If you need more details or find this post useful please let me know.

I will continue my "quest" for developing a small S.F.A. application on the iPhone and/or iPad using MonoTouch.


SocketPrint

4 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. Thanks to say for posting this blog. We have to get new collection of news from your end. All the best for you best support. Keep updataing your blog. This is really nice job Postcard Printing

    ReplyDelete
  3. I think print from iPhone so complicated. or maybe I do not have an iPhone so do not understand. but this article was helpful problem Resep Kue Nastar

    ReplyDelete
  4. Hi, Is it possible to create Print in Windows Phone 8..

    ReplyDelete