Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

separator-sheets-type option isn't handled correctly #90

Open
JakeTompkins opened this issue Dec 22, 2020 · 0 comments
Open

separator-sheets-type option isn't handled correctly #90

JakeTompkins opened this issue Dec 22, 2020 · 0 comments

Comments

@JakeTompkins
Copy link

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'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant