Skip to content

Can't set tray-2 #105

@mbuk

Description

@mbuk

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();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions