How to use ipp(Internet Printing Protocol) with HTTP to print file in android?

10,601

You need to make an HTTP PUT request with some special features, you must:

  • use the port 631 instead of 80 (unless it's explicitly specified of course).
  • rewrite the url in the header (i.e. ipp:// => http://).
  • protocol ID is IPP/1.1.
  • you must authenticate via a challenge method.

OTOH, the request/response format used in the body is binary, so you should really really read the RFC. Besides that, it's quite simple, all you need is job and printer URIs, and then you just send properly encoded data.

Share:
10,601
Ramesh Solanki
Author by

Ramesh Solanki

i am senior android developer with 5 years experience, working at ahmedabad

Updated on June 15, 2022

Comments

  • Ramesh Solanki
    Ramesh Solanki almost 2 years

    I want to print file from android application.For the same , after searching on google,I found some useful information that i will have to use IPP (Internet Printing Protocol) with HTTP. And I am new to ipp but i have worked with HTTP. So can anybody help me for the same ? Can anybody give me some useful information OR links? Thanks in advance ?

  • Ramesh Solanki
    Ramesh Solanki over 12 years
    Thanks for your reply ! Can you give me hint how to make request using header ipp:// in android as i only have ip address of printer ?
  • Ismael Luceno
    Ismael Luceno over 12 years
    that's all you need, ipp://ip:631 in the body and http://ip:631 in the HTTP header... just open a socket and start writing...
  • Ramesh Solanki
    Ramesh Solanki over 12 years
    Is there any link to get sample code to make above request ? Because I am not able to code to open socket in android.Can you please give me such information ?
  • Ramesh Solanki
    Ramesh Solanki over 12 years
  • Ismael Luceno
    Ismael Luceno over 12 years
    If you don't care about compatibility, using a CGI could be a good idea.
  • Ismael Luceno
    Ismael Luceno over 12 years
    You may want to take a look at the gnu.javax.print.IppPrintService class. It may or may not work on Android... I've had no chance to try it.
  • Ramesh Solanki
    Ramesh Solanki over 12 years
    gnu.javax.print.IppPrintService is not available in android.Is there any other way to do it ?
  • Ramesh Solanki
    Ramesh Solanki over 12 years
  • Ramesh Solanki
    Ramesh Solanki over 12 years
  • IPP Nerd
    IPP Nerd almost 8 years
    jspi is based on javax.print which is unsupported on android: stackoverflow.com/questions/4418530/…