ipp icon indicating copy to clipboard operation
ipp copied to clipboard

Can't set tray-2

Open mbuk opened this issue 2 years ago • 1 comments

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 avatar Dec 11 '23 15:12 mbuk

I can see these as supported trays

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

mbuk avatar Dec 11 '23 15:12 mbuk