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

Can't set tray-2 #105

Open
mbuk opened this issue Dec 11, 2023 · 1 comment
Open

Can't set tray-2 #105

mbuk opened this issue Dec 11, 2023 · 1 comment

Comments

@mbuk
Copy link

mbuk commented Dec 11, 2023

I'm really struggling trying to get a brother HL-L5100DN to print using tray-2

It always defaults to tray 1 regardless of how I try to set it,

I must be missing something obviously wrong but I can't see it .....

var ipp = require("ipp");
var PDFDocument = require("pdfkit");

var doc = new PDFDocument;
doc.text("Hello World");

var buffers = [];
doc.on('data', buffers.push.bind(buffers));
doc.on('end', function () {
  var printer = ipp.Printer("http://192.168.10.58:631/ipp/printer");
  var file = {
    "operation-attributes-tag":{
      "requesting-user-name": "User",
      "job-name": "Print Job",
      "document-format": "application/octet-stream"
    },
    "printer-attributes": {
      "media-col": {
         "media-source": "tray-2"
      },
    },
    "job-attributes-tag":{
      "media-col": {
        "media-source": "tray-2"
      }
    },
    data: Buffer.concat(buffers)
  };

  printer.execute("Print-Job", file, function (err, res) {
    console.log("Printed: "+res.statusCode);
  });
});
doc.end();
@mbuk
Copy link
Author

mbuk commented Dec 11, 2023

I can see these as supported trays

"media-source-supported": [
      "auto",
      "by-pass-tray",
      "tray-1",
      "tray-2"
    ],

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