TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

GetPageWidth

GetPageWidth() → { twips }

Gets page width for current section.

Parameters:

This method doesn't have any parameters.

Returns:

Type
twips

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
var oSection = oDocument.GetFinalSection();
var nWidth = oSection.GetPageWidth();
oParagraph.AddText("Page width = " + nWidth);
builder.SaveFile("docx", "GetPageWidth.docx");
builder.CloseFile();

Resulting document