I am currently working on integrating IPP printing capabilities in my Android application using the JIPP library. While constructing an IPP request, I encountered an issue where adding specific attributes leads to a client-error-bad-request
response from the printer.
Here are the details:
Printer Model: HP Color LaserJet M555
Printer Capabilities Extract:
-
sides-supported=[one-sided, two-sided-long-edge, two-sided-short-edge]
-
copies-supported=1..32000
IPP Request Construction:
When I construct the IPP request with only the essential attributes, it works perfectly:
IppPacket.Builder builder = IppPacket.printJob(uri)
.putOperationAttributes(
printerUri.of(uri),
requestingUserName.of("user")
);
This request prints successfully. However, when I add the copies and sides attributes, the printer responds with a client-error-bad-request.
Here is the modified code that results in the error:
IppPacket.Builder builder = IppPacket.printJob(uri)
.putOperationAttributes(
printerUri.of(uri),
requestingUserName.of("user"),
documentFormat.of("application/pdf"),
copies.of(1), // Adding copies attribute
sides.of("one-sided") // Adding sides attribute
);
Error Response:
IppPacketData(packet=IppPacket(v=0x200, c=client-error-bad-request(1024), r=0x1) [AttributeGroup(operation-attributes, [attributes-charset="utf-8" (charset), attributes-natural-language="en" (naturalLanguage)])], data=com.hp.jipp.encoding.IppInputStream@86751ed)
Given that the printer’s capabilities indicate support for one-sided
and copies
ranging from 1 to 32000, why would including these attributes in the IPP request result in a client-error-bad-request
? Is there a specific format or additional attribute dependencies required when adding copies
and sides
that I might be missing?
Additional Information:
-
IPP Library: JIPP
-
Network Setup: The printer is connected and reachable via the provided URI.
-
Log Output: Detailed logging of the IPP request and response is available if needed for further debugging.
I appreciate any guidance or suggestions you can provide to resolve this issue.