Skip to main content

Класс PageProperties

Класс PageProperties предоставляет такие свойства страницы как высота, ширина, размеры полей. Размеры страницы представлены в пунктах (pt). Например, для листа формата А4 значение ширины составляет 595,29 pt, высоты – 841,90 pt (без округления). Используется в Document.setPageProperties(), Section.getPageProperties(), Section.setPageProperties().

ПолеТипОписание
PageProperties.heightfloatВысота страницы
PageProperties.widthfloatШирина страницы
PageProperties.marginsInsetsПоля страницы

Примеры​


block = document.getBlocks().getBlock(0)
firstSection = block.getSection()
pageProperties = firstSection.getPageProperties()
pageProperties.height = 100
pageProperties.width = 50
document.setPageProperties(pageProperties)
pageProperties = myOfficeSDK.PageProperties()
pageProperties.height = 100
pageProperties.width = 50
document.setPageProperties(pageProperties)
pageProperties = myOfficeSDK.PageProperties(100, 50)
document.setPageProperties(pageProperties)