I am trying print the pdf file in my local using printer. This is a code, tried to print.
fs.readFile('documents/AccountStatement.pdf', function(err, data) {
if (err)
throw err;
var printer = ipp.Printer("http://hostname:631/ipp/printer");
var msg = {
"operation-attributes-tag": {
"requesting-user-name": "KUMA1936",
"job-name": "My Test Job",
"document-format": "application/pdf"
},
data: data
};
printer.execute("Print-Job", msg, function(err, res){
console.log(res);
console.log(err);
});
});
In the above code what does printer.execute() method and "Print-Job" parameter. And what does 631 here.When i print the res,its shows
{ version: '1.1', statusCode: 'server-error-operation-not-supported', id: 442076, 'operation-attributes-tag': { 'attributes-charset': 'utf-8', 'attributes-natural-language': 'en-us' } } err is null.