SetPageSize
function SetPageSize(nWidth: twips = null, nHeight: twips = null, isPortrait: boolean = false): void
Description
Specifies the properties (size and orientation) for all the pages in the current section.
Parameters
The page width measured in twentieths of a point (1/1440 of an inch).
The page height measured in twentieths of a point (1/1440 of an inch).
- isPortrait
boolean
false Specifies the orientation of all the pages in this section (if set to true, then the portrait orientation is chosen).
Returns
void
Try It
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("This is a page with a page size set. ");
oParagraph.AddText("The page width is 5 inches (7200 twentieths of a point). ");
oParagraph.AddText("The page height is 3 inches (4320 twentieths of a point). ");
oParagraph.AddText("The font size is default (11 points).");
var oSection = oDocument.GetFinalSection();
oSection.SetPageMargins(720, 720, 720, 720);
oSection.SetPageSize(7200, 4320);