<div dir="ltr"><div>Hi</div><div><br></div><div>I want to get all the job attributes
like Pagesize, PaperType, Paper source for the job. I am using the
following code to get that information.<br></div><div><br></div><div>static const char * const jattrs[] = /* Job attributes we want */<br> {<br> "job-template",<br> "job-description",<br> "all"<br> };<br> httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,<br> "localhost", ippPort(), "/printers/%s", printer);<br> /* Getting the resource */<br> resource = uri + (strlen(uri) - strlen(printer) - 10);<br> http = http_connect_local();<br> request = ippNewRequest(IPP_OP_GET_JOB_ATTRIBUTES);<br> ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL,uri);<br> ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id",job_id);<br> ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, cupsUser());<br> ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", <br> (int)(sizeof(jattrs) / sizeof(jattrs[0])), NULL, jattrs);<br><br> response = cupsDoRequest(http, request,resource);<br> attr = ippFirstAttribute(response);</div><div><br></div><div><br></div><div>The output of the code is :</div><div><div><div>attributes-charset,utf-8</div><div>attributes-natural-language,en-in</div><div>number-of-documents,1</div><div>job-media-progress,0</div><div>job-more-info,<a href="http://localhost/jobs/103" target="_blank">http://localhost/jobs/103</a></div><div>job-printer-up-time,1553796490</div><div>job-printer-uri,ipp://localhost/printers/grp</div><div>job-uri,ipp://localhost/jobs/103</div><div>job-originating-user-name,deepak</div><div>printer-uri,ipp://localhost:631/printers/grp</div><div>job-name,ASL350_Assignment.pdf</div><div>number-up,1</div><div>PageSize,A4</div><div><b>MediaType,Envelope</b></div><div>Collate,false</div><div>job-priority,50</div><div>job-sheets,none,none</div><div>Duplex,None</div><div>document-format-detected,application/pdf</div><div>document-format,application/pdf</div><div>job-uuid,urn:uuid:e5aa7490-eb34-3200-6a64-7e43ca050a39</div><div>cups-browsed,true</div><div>job-originating-host-name,localhost</div><div>date-time-at-completed,no-value</div><div>date-time-at-creation,2019-03-28T18:08:10Z</div><div>date-time-at-processing,2019-03-28T18:08:10Z</div><div>time-at-completed,no-value</div><div>time-at-creation,1553796490</div><div>time-at-processing,1553796490</div><div>job-id,103</div><div>job-state,processing</div><div>job-state-reasons,job-printing</div><div>job-impressions-completed,0</div><div>job-media-sheets-completed,0</div><div>job-k-octets,51</div><div>job-hold-until,no-hold</div><div><br></div><div>1. The media-col attribute is not returned in the request. How I can change the request to get media-col ?</div><div>2. The paper type is given as "MediaType Envelope", How I can get the media-type from the response ? I tried: <br></div><div> if ((attr = ippFindAttribute(response, "MediaType", <br> IPP_TAG_KEYWORD)) != NULL && ippGetCount(attr)>0){<br></div><div><br></div><div><br></div><div> if ((attr = ippFindAttribute(response, "media-type", <br> IPP_TAG_KEYWORD)) != NULL && ippGetCount(attr)>0){</div><div><br></div><div><div><img src="cid:ii_ju3t84c50" alt="Screenshot from 2019-03-28 23-15-00.png" width="493" height="277"><br></div></div></div></div></div>