ipp
ipp copied to clipboard
separator-sheets-type option isn't handled correctly
The below is the msg I'm sending with a print job request. The type defined for "separator-sheets-type" is an array of strings, which you can see is what I've given it, but whenever I try to send the request, an error is thrown by the serializer. I've included the error below. It looks like the serializer isn't handling the array properly, but I'm having trouble working through the serializer logic to find out what exactly it's supposed to do.
const options: ipp.PrintJobRequest = {
"operation-attributes-tag": {
"requesting-user-name": "Print-Server",
"document-format": "application/pdf",
},
"job-attributes-tag": {
"separator-sheets": {
"media-col": {
"media-source": "tray-1",
},
"separator-sheets-type": ["end-sheet"],
},
},
data,
};
TypeError [ERR_INVALID_ARG_TYPE]: The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received an instance of Array
at new NodeError (node:internal/errors:277:15)
at Function.byteLength (node:buffer:712:11)
at write (.../ipp/lib/serializer.js:34:25)
at writeValue (.../ipp/lib/serializer.js:197:12)
at /.../ipp/lib/serializer.js:229:4
at Array.forEach (<anonymous>)
at writeCollection (.../ipp/lib/serializer.js:213:22)
at writeValue (.../ipp/lib/serializer.js:201:12)
at .../ipp/lib/serializer.js:98:4
at Array.forEach (<anonymous>) {
code: 'ERR_INVALID_ARG_TYPE'
}