[IPP] Documentation for "How to use the Internet Printing Protocol"

[IPP] Documentation for "How to use the Internet Printing Protocol"

John Madden jpmsparks at yahoo.com
Thu Feb 29 01:30:13 UTC 2024


Looks like the example for the CREATE-JOB, SEND-DOCUMENT code needs to 
be updated in the “How to Use the Internet Printing Protocol” document. 
Kept getting a 1024 error codeusing cupsDoFileRequest - I had to use the 
"last-document" boolean to the SEND_DOCUMENT op before it finally 
worked. Appears the *last-document* boolean is required. The 
*last-document* attribute does not appear as a required attribute in the 
Common Operations section of the document in Appendix A either.

//****code below****

request = ippNewRequest(IPP_OP_SEND_DOCUMENT);
status = ippGetStatusCode(request);
if ((status == IPP_STATUS_OK)||(status == 
IPP_STATUS_OK_BUT_CANCEL_SUBSCRIPTION))
{
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id", 
iJobId);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", 
NULL, szUriTag);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, 
"requesting-user-name", NULL, userName);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, 
"document-format", NULL, getMimeType(filetoPrint));
//must include the 'last-document' op or this will fail..
**ippAddBoolean(request, IPP_TAG_OPERATION, "last-document", 1);**
response = cupsDoFileRequest(http, request, "/ipp/print", filetoPrint);
status = ippGetStatusCode(response);

|||if (response)|
|||{|
|||ippDelete(response);|
|||}|
|}|

|//**** ||end code ****|

Also, could you add a code example for the Cancel-Job (with a job ID)? I 
am following the guidelines for required attributes (Appendix A) but get 
a 1024 for this op as well. Thanks for the great work!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pwg.org/pipermail/ipp/attachments/20240228/a6da7859/attachment.html>


More information about the ipp mailing list