TRUECALC
MCP

view:setPageSetup

Sets the page setup.

Parameters

NameTypeRequiredDescription
sheetstringyes
orientation"portrait", "landscape" or nullno
scale{ mode: "normal", "fitWidth", "custom"; percent?: number or null } or nullno
marginsMode"normal", "narrow", "custom" or nullno
customMargins{ top: number; right: number; bottom: number; left: number } or nullno
printArea{ r0: integer; r1: integer; c0: integer; c1: integer } or nullnoThree states.
showGridlinesboolean or nullno
header{ left?: string or null; center?: string or null; right?: string or null } or nullno
footer{ left?: string or null; center?: string or null; right?: string or null } or nullno

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"
          ]
        }
      }
    }
  }
}

On this page