ipp
ipp copied to clipboard
Question: How does margin support work?
Hey you guys! :)
I see a lot of printers saying media-*-margin-supported = 423. I myself have one here as follow:
"media-col-default": {
"media-size": {
"x-dimension": 21000,
"y-dimension": 29700
},
"media-top-margin": 423,
"media-bottom-margin": 423,
"media-left-margin": 423,
"media-right-margin": 423,
"media-source": "auto",
"media-type": "stationery",
"duplex-supported": 0
},
"media-left-margin-supported": 423,
"media-right-margin-supported": 423,
"media-top-margin-supported": 423,
"media-bottom-margin-supported": 423,
But I have seen some throughout the Internet with different values as an array like:
'media-right-margin-supported': [428, 423, 421, 445, 406, 432, 433, 419].
OK. My question is: Does that mean the given printer supports only the specified list of values?
I wondering this because I'm trying to print a PDF with zero margin but the printer is applying 423 no matter what:
var msg = {
'operation-attributes-tag': {
'requesting-user-name': 'codezone',
'job-name': 'test',
'document-format': 'application/pdf'
},
'job-attributes-tag': {
'media-col': {
'media-source': 'tray-1',
'media-type': 'stationery',
'media-size': {
'x-dimension': 14800,
'y-dimension': 21000
},
'media-top-margin': 0,
'media-bottom-margin': 0,
'media-left-margin': 0,
'media-right-margin': 0
},
'margins-pre-applied': true,
'orientation-requested': 'portrait'
},
data: data
};
I appreciate any help.
Thanks!
@leandrosilva The "media-xxx-margin-supported" attributes report the supported values for all media sizes. In many printers, different media sizes have different margins - for example, HP printers historically had left/right margins of .25 inch for US Letter but .135 inch for A4 (both yielding an 8 inch printable width). You know which margins go with which sizes by looking at the "media-col-database" and "media-col-ready" attributes (the latter listing the media that is actually loaded in the printer). Margins for some printers can also vary depending on the print mode, for example when doing 2-sided printing.
Now, media margins are a separate thing from document margins (like what you have in a PDF file). Printers can use the page size and margin information in an input document (e.g. PDF file) to scale/offset the document for printing - the "print-scaling" attribute (when supported) provides some control over this.
A printer that does not support borderless (media-xxx-margin=0) printing physically cannot print all the way to the edge of the sheet (even if you specify 0 margins in the print request), so typically a borderless PDF file (like a full-bleed brochure) will get clipped at the edges unless you tell the printer to scale (via the "print-scaling" attribute).
Thank you @michaelrsweet