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

一曲冷凌霜 提交于 2019-11-30 15:29:59

问题


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 ?


回答1:


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.




回答2:


You can look at this sample http://code.google.com/p/jspi/source/browse/trunk/jspi/src/main/java/de/lohndirekt/print/examples/SimpleDocExample.java. It is a Java library for IPP.



来源:https://stackoverflow.com/questions/8570882/how-to-use-ippinternet-printing-protocol-with-http-to-print-file-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!