{"action":"created","issue":{"url":"https://api.github.com/repos/williamkapke/ipp/issues/42","repository_url":"https://api.github.com/repos/williamkapke/ipp","labels_url":"https://api.github.com/repos/williamkapke/ipp/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/williamkapke/ipp/issues/42/comments","events_url":"https://api.github.com/repos/williamkapke/ipp/issues/42/events","html_url":"https://github.com/williamkapke/ipp/issues/42","id":229256815,"number":42,"title":"Cannot print on another tray","user":{"login":"Batajus","id":5472013,"avatar_url":"https://avatars2.githubusercontent.com/u/5472013?v=4","gravatar_id":"","url":"https://api.github.com/users/Batajus","html_url":"https://github.com/Batajus","followers_url":"https://api.github.com/users/Batajus/followers","following_url":"https://api.github.com/users/Batajus/following{/other_user}","gists_url":"https://api.github.com/users/Batajus/gists{/gist_id}","starred_url":"https://api.github.com/users/Batajus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Batajus/subscriptions","organizations_url":"https://api.github.com/users/Batajus/orgs","repos_url":"https://api.github.com/users/Batajus/repos","events_url":"https://api.github.com/users/Batajus/events{/privacy}","received_events_url":"https://api.github.com/users/Batajus/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-05-17T07:08:34Z","updated_at":"2018-02-13T21:36:12Z","closed_at":"2017-10-17T00:59:26Z","author_association":"NONE","body":"Hey guys,\r\ni'm trying to print a document on the second paper tray.\r\n\r\nMy printer supports following media sources: \r\n`'media-source-supported': [ 'tray-1', 'tray-2', 'tray-3', 'tray-1-man' ],`\r\n\r\nI'm using the code from your printPDF.js sample:\r\n`    var file = {\r\n        \"operation-attributes-tag\": {\r\n            \"requesting-user-name\": \"User\",\r\n            \"job-name\": \"Print Job\",\r\n            \"document-format\": \"application/pdf\"\r\n        },\r\n        \"job-attributes-tag\": {\r\n            \"media-col\": {\r\n                \"media-source\": \"tray-2\"\r\n            }\r\n        },\r\n        data: data\r\n    };`\r\n\r\nBut my printer always shows the error message you need to add paper to the first tray.\r\nDo you have any ideas?"},"comment":{"url":"https://api.github.com/repos/williamkapke/ipp/issues/comments/365412349","html_url":"https://github.com/williamkapke/ipp/issues/42#issuecomment-365412349","issue_url":"https://api.github.com/repos/williamkapke/ipp/issues/42","id":365412349,"user":{"login":"Batajus","id":5472013,"avatar_url":"https://avatars2.githubusercontent.com/u/5472013?v=4","gravatar_id":"","url":"https://api.github.com/users/Batajus","html_url":"https://github.com/Batajus","followers_url":"https://api.github.com/users/Batajus/followers","following_url":"https://api.github.com/users/Batajus/following{/other_user}","gists_url":"https://api.github.com/users/Batajus/gists{/gist_id}","starred_url":"https://api.github.com/users/Batajus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Batajus/subscriptions","organizations_url":"https://api.github.com/users/Batajus/orgs","repos_url":"https://api.github.com/users/Batajus/repos","events_url":"https://api.github.com/users/Batajus/events{/privacy}","received_events_url":"https://api.github.com/users/Batajus/received_events","type":"User","site_admin":false},"created_at":"2018-02-13T21:36:12Z","updated_at":"2018-02-13T21:36:12Z","author_association":"NONE","body":"I found another solution for my issue: \r\n\r\n```\r\nvar ipp = require('./../ipp');\r\nvar PDFDocument = require('pdfkit');\r\nvar concat = require(\"concat-stream\");\r\n\r\nvar doc = new PDFDocument({margin:0});\r\ndoc.text(\".\", 0, 0);\r\n\r\n\r\ndoc.pipe(concat(function (data) {\r\n\tvar printer = ipp.Printer(\"http://cp02.local.:631/ipp/printer\");\r\n\tvar msg = {\r\n\t\t\"operation-attributes-tag\": {\r\n\t\t\t\"requesting-user-name\": \"Bumblebee\",\r\n\t\t\t\"job-name\": \"whatever.pdf\",\r\n\t\t\t\"document-format\": \"application/pdf\"\r\n\t\t},\r\n\t\t\"job-attributes-tag\":{\r\n\t\t\t\"media\": [ \"tray-2\" ] // <- This worked for me\r\n\t\t}\r\n\t\t, data: data\r\n\t};\r\n\tprinter.execute(\"Print-Job\", msg, function(err, res){\r\n\t\tconsole.log(err);\r\n\t\tconsole.log(res);\r\n\t});\r\n}));\r\ndoc.end();\r\n```\r\nI used [this](https://tools.ietf.org/html/rfc2566) (4.2.11) for my solution.\r\n\r\nBut i will try your fix as soon as possible and inform you about the results ;-)"}}
{"actor":{"display_login":"Batajus"}}