MCP
view:setPageSetup
Sets the page setup.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
sheet | string | yes | — |
orientation | "portrait", "landscape" or null | no | — |
scale | { mode: "normal", "fitWidth", "custom"; percent?: number or null } or null | no | — |
marginsMode | "normal", "narrow", "custom" or null | no | — |
customMargins | { top: number; right: number; bottom: number; left: number } or null | no | — |
printArea | { r0: integer; r1: integer; c0: integer; c1: integer } or null | no | Three states. |
showGridlines | boolean or null | no | — |
header | { left?: string or null; center?: string or null; right?: string or null } or null | no | — |
footer | { left?: string or null; center?: string or null; right?: string or null } or null | no | — |
Returns
Nothing beyond the standard MCP success envelope.
Schema
Request payload, as JSON Schema:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Payload",
"type": "object",
"properties": {
"sheet": {
"type": "string"
},
"orientation": {
"anyOf": [
{
"$ref": "#/$defs/WireOrientation"
},
{
"type": "null"
}
]
},
"scale": {
"anyOf": [
{
"$ref": "#/$defs/WireScale"
},
{
"type": "null"
}
]
},
"marginsMode": {
"anyOf": [
{
"$ref": "#/$defs/WireMarginsMode"
},
{
"type": "null"
}
]
},
"customMargins": {
"anyOf": [
{
"$ref": "#/$defs/WireMargins"
},
{
"type": "null"
}
]
},
"printArea": {
"description": "Three states.",
"anyOf": [
{
"$ref": "#/$defs/WirePrintArea"
},
{
"type": "null"
}
]
},
"showGridlines": {
"type": [
"boolean",
"null"
]
},
"header": {
"anyOf": [
{
"$ref": "#/$defs/WireHeaderFooter"
},
{
"type": "null"
}
]
},
"footer": {
"anyOf": [
{
"$ref": "#/$defs/WireHeaderFooter"
},
{
"type": "null"
}
]
}
},
"required": [
"sheet"
],
"$defs": {
"WireOrientation": {
"type": "string",
"enum": [
"portrait",
"landscape"
]
},
"WireScale": {
"type": "object",
"properties": {
"mode": {
"$ref": "#/$defs/WireScaleMode"
},
"percent": {
"type": [
"number",
"null"
],
"format": "double"
}
},
"required": [
"mode"
]
},
"WireScaleMode": {
"type": "string",
"enum": [
"normal",
"fitWidth",
"custom"
]
},
"WireMarginsMode": {
"type": "string",
"enum": [
"normal",
"narrow",
"custom"
]
},
"WireMargins": {
"type": "object",
"properties": {
"top": {
"type": "number",
"format": "double"
},
"right": {
"type": "number",
"format": "double"
},
"bottom": {
"type": "number",
"format": "double"
},
"left": {
"type": "number",
"format": "double"
}
},
"required": [
"top",
"right",
"bottom",
"left"
]
},
"WirePrintArea": {
"type": "object",
"properties": {
"r0": {
"type": "integer",
"format": "uint32",
"minimum": 0
},
"r1": {
"type": "integer",
"format": "uint32",
"minimum": 0
},
"c0": {
"type": "integer",
"format": "uint32",
"minimum": 0
},
"c1": {
"type": "integer",
"format": "uint32",
"minimum": 0
}
},
"required": [
"r0",
"r1",
"c0",
"c1"
]
},
"WireHeaderFooter": {
"type": "object",
"properties": {
"left": {
"type": [
"string",
"null"
]
},
"center": {
"type": [
"string",
"null"
]
},
"right": {
"type": [
"string",
"null"
]
}
}
}
}
}