public void WritePageInfo()
{
//ExStart
//ExFor:PageInfo
//ExFor:PageInfo.PaperSize
//ExFor:PageInfo.PaperTray
//ExFor:PageInfo.Landscape
//ExFor:PageInfo.WidthInPoints
//ExFor:PageInfo.HeightInPoints
//ExSummary:Retrieves page size and orientation information for every page in a Word document.
Document doc = new Document(MyDir + "Rendering.doc");
Console.WriteLine("Document \"{0}\" contains {1} pages.", doc.OriginalFileName, doc.PageCount);
for (int i = 0; i < doc.PageCount; i++)
{
PageInfo pageInfo = doc.GetPageInfo(i);
Console.WriteLine(
"Page {0}. PaperSize:{1} ({2:F0}x{3:F0}pt), Orientation:{4}, PaperTray:{5}",
i + 1,
pageInfo.PaperSize,
pageInfo.WidthInPoints,
pageInfo.HeightInPoints,
pageInfo.Landscape ? "Landscape" : "Portrait",
pageInfo.PaperTray);
}
//ExEnd
}