跳到主要内容

GetPageWidth

Gets page width for current section.

Syntax

expression.GetPageWidth();

expression - A variable that represents a ApiSection class.

Parameters

This method doesn't have any parameters.

Returns

twips

Example

This example shows how to get the page width.

// How to get the page width.

// Get the final section of the page and get its width.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
let section = doc.GetFinalSection();
let width = section.GetPageWidth();
paragraph.AddText("Page width = " + width);