2

I want to send data directly to the ethernet printer from my iPad. Is there any API for this?

Burak
  • 5,706
  • 20
  • 70
  • 110
  • This answer might be what you're looking for: http://stackoverflow.com/questions/4373420/how-to-print-in-ios-4-2 – Jag Nov 01 '11 at 23:17
  • Actually I don't want to print via AirPrint. Just send the print data to ip of the printer, without any GUI that is shown in iPad/iPhone to select printer. – Burak Nov 03 '11 at 07:57

1 Answers1

3

If you had some PDF, Postscript, PCL or other data file in a format that was supported by the printer you could simply open port 9100 to the IP of the printer and send the data.

Virtually all network printers can talk talked to over 9100. You can also use port 515 but that requires that you have an LPR client. Port 9100 will simply receive your data as 'RAW' and print whatever is in the stream. It means that you must output something the printer understands such as PCL/PS (PDF for some devices) etc.

You can also send simple text with no control codes will be treated as PCL by most devices applying whatever the default font, orientation etc. is set.

You can try this on a desktop PC to a printer by using telnet to port 9100 of a printer. Once telnet is open, type some text and close telnet (or wait for the printer to timeout). Your text should print.

Douglas Anderson
  • 4,652
  • 10
  • 40
  • 49
  • Thank you sir for the reply. Do you mean, to any ethernet printer with an IP in same network, if I open it's 9100 port somehow and send data over network to that port, it will directly print? – Burak Nov 03 '11 at 08:13
  • Added some of this detail to the answer. – Douglas Anderson Nov 03 '11 at 13:14