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

Print-Scaling Unknown Attribute #78

Open
cah-brandon-trebbien opened this issue Sep 19, 2019 · 6 comments
Open

Print-Scaling Unknown Attribute #78

cah-brandon-trebbien opened this issue Sep 19, 2019 · 6 comments

Comments

@cah-brandon-trebbien
Copy link

Getting the below error submitting a print request.

/home/vcap/app/node_modules/ipp/lib/serializer.js:73
if(!groupName) throw "Unknown attribute: " + name;
^
Unknown attribute: print-scaling

If I remove the attribute, print succeeds but is not scaling to fit the page. I see print-scaling is listed under the supported attributes in the serializer so not sure what is causing the issue. Here is the request being submitted:

fs.readFile('/path/to/file', (err, pdf) => {
if (err) throw err;
var msg = {
"operation-attributes-tag": {
"requesting-user-name": "Name",
"job-name": "MyTestJob",
"document-format": "application/pdf"
},
"job-attributes-tag": {
"sides": "one-sided",
"finishings": "staple",
"print-scaling": "fit"
},
data: pdf
};
printer.execute("Print-Job", msg, function(err, res){
console.log(res);
});

@cah-brandon-trebbien
Copy link
Author

Looks like this option got added in the one of the pull requests from last month. #77

65dd94a

@cah-brandon-trebbien
Copy link
Author

Can the latest master branch be pushed to npm?

@cah-brandon-trebbien
Copy link
Author

When I do npm install building from latest copy of master I am now getting the below:

The spec is not clear on how to handle tag 16: print-scaling=undefined. Please open a github issue to help find a solution!
{ version: '2.0',
statusCode: 'successful-ok-ignored-or-substituted-attributes',
id: 19048765,
'operation-attributes-tag':
{ 'attributes-charset': 'utf-8',
'attributes-natural-language': 'en-us',
'status-message': 'successful-ok-ignored-or-substituted-attributes' },
'unsupported-attributes-tag': { 'print-scaling': undefined },
'job-attributes-tag':
{ 'job-uri': '#######',
'job-id': 1543,
'job-state': 'processing',
'job-state-reasons': 'none',
'job-state-message': 'none',
'number-of-intervening-jobs': 0 } }

@nikes
Copy link

nikes commented Nov 7, 2019

HP LaserJet MFP M426fdw support too scaling

{
  "job-creation-attributes-supported": [
    "copies",
    "finishings",
    "sides",
    "orientation-requested",
    "media",
    "print-quality",
    "printer-resolution",
    "output-bin",
    "media-col",
    "output-mode",
    "ipp-attribute-fidelity",
    "job-name",
    "page-ranges",
    "multiple-document-handling",
    "pdf-fit-to-page",
    "print-scaling",
    "print-color-mode",
    "print-content-optimize",
    "manual-duplex-sheet-count",
    "margins-pre-applied",
    "pclm-source-resolution"
  ],
  "print-scaling-default": "auto",
  "print-scaling-supported": [
    "auto",
    "auto-fit",
    "fill",
    "fit",
    "none"
  ]
}

@de-Lovey
Copy link

Print scaling is an invalid attribute, but you can add the media attribute to specify the paper size. Although this attribute has a default value, it seems that this package did not pass in this default value by default, resulting in incomplete display during printing

const printJob = {
'operation-attributes-tag': {
'attributes-charset': 'utf-8',
'requesting-user-name': 'User',
'job-name': 'Print-Job',
'document-format': 'application/pdf'
},
'job-attributes-tag': {
media: 'iso_a4_210x297mm'
},
data: buffer
}

Perfect solution to size issues during printing!

@superdrenner
Copy link

Bump:

Can the latest master branch be pushed to npm?

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

4 participants