sections.setPageSetup
Set page size/orientation properties for a section. Changing orientation writes only the page size: width and height swap so the long side matches the orientation, unless width or height is given. Page margins stay as they are; to change them with the orientation, call sections.setPageMargins. Portrait is written without an orient attribute, as Word does. No named paper sizes are defined, so a paperSize other than the paper code the section already has (as sections.get reports it) is rejected with INVALID_INPUT; set width and height instead.
doc.sections.setPageSetup(…)Expected result
Returns a SectionMutationResult receipt; reports NO_OP if page size and orientation already match the requested values.
Inputs
targetSectionAddressrequiredFields
kind"section"requiredsectionIdstringrequiredwidthnumberconditionally requiredheightnumberconditionally requiredorientation"portrait" | "landscape"conditionally requiredpaperSizestringconditionally requiredResult
Output fields
true
successtruerequireddryRunbooleansectionSectionAddressrequiredFields
kind"section"requiredsectionIdstringrequiredappliedChangeMode"direct" | "tracked"false
successfalserequiredfailureobjectrequiredFields
code"NO_OP" | "INVALID_TARGET" | "CAPABILITY_UNAVAILABLE"requiredmessagestringrequireddetailsunknownFailures
Pre-apply throws
TARGET_NOT_FOUNDINVALID_TARGETINVALID_INPUT
2 more codes
CAPABILITY_UNAVAILABLEINTERNAL_ERROR
Non-applied receipt codes
NO_OPINVALID_TARGETCAPABILITY_UNAVAILABLE
Raw schemas
Open the generated JSON artifact for the exact input, output, success, and failure schemas represented by this contract version.
View raw JSON schemas