[Root] / Xceed.PdfLibrary.NET Assembly / Xceed.PdfLibrary.NET Namespace / Page Class
Example
In This Topic
    Page Class
    In This Topic
    Represents a page.
    Object Model
    Page ClassLayoutResult ClassLayoutResult ClassPageFormFieldCollection ClassFormField ClassCanvas ClassPageHyperlinkCollection ClassHyperlink ClassImageCollection ClassImage ClassPageSettings ClassPagePathObjectCollection ClassPathObject ClassWatermarkCollection ClassWatermark Class
    Syntax
    public sealed class Page 
    Remarks
    This class cannot be inherited.
    Example
    using( var pdfoutput = PdfDocument.Load( inputPath ) )
    {
      var totalPages = pdfDoc.Pages.Count;
                
      // Gets text-related statistics for the first 10 pages.
      foreach(var page in pdfDoc.Pages.Take( 10 ) )
      {
        var pageId = page.Id;
        var pageSize = new Size( page.PageSettings.Width, page.PageSettings.Height );
        var wordCount = page.Words.Count();
        var imageCount = page.Images.Count();
        var hyperlinkCount = page.Hyperlinks.Count();
      }
    }
    Inheritance Hierarchy

    System.Object
       Xceed.PdfLibrary.NET.Page

    Public Properties
     NameDescription
    Public PropertyGets the form fields.  
    Public PropertyGets the graphics.  
    Public PropertyGets the hyperlinks.  
    Public PropertyGets the identifier.  
    Public PropertyGets the page's visible images. Excludes images the document marks as not part of the visible page.  
    Public Property Useful for when texts are not on the same lines to order them from top left to bottom right. Not useful when using tables or columns of texts. Excludes text the document marks as not part of the visible page.  
    Public PropertyGets or sets the page settings.  
    Public PropertyGets the page's visible path objects. Excludes paths the document marks as not part of the visible page.  
    Public PropertyGets the rotation.  
    Public Property Returns the text in the order it is added in the pdf, not always the same as the visual result. Excludes text the document marks as not part of the visible page.  
    Public PropertyGets the Watermarks resolved on this Page.  
    Public Property Only for languages where words are separated by spaces, not for some asian languages. Excludes text the document marks as not part of the visible page.  
    Top
    Public Methods
     NameDescription
    Public MethodOverloaded.  This method evaluates the Margin property first, and the starting point of draw the text will be the Margin + verticalPosition, for Top-Left. About the width of the text, this will be limited by the Margin property bounds. In the case of the Height, no matter what's the value inserted, this will be limited too by the Margin.Bottom bounds, playing with Page.Height property.  
    Public MethodOverloaded. Adds text.  
    Public MethodFinds occurrences of the given text within the visible text content of the page.  
    Public MethodGets the text inside a Rectangle. Excludes text the document marks as not part of the visible page.  
    Public MethodOverloaded. Removes a text from the editable text content of the page.  
    Public MethodOverloaded. Replaces a text from the editable text content of the page with a new text. The new text will use the replacementTextStyle and if not defined, the new text will use the same font as the found text. Please note that if the font from the found text (or the replacementTextStyle font) is a Font from this PDF, it may be an embedded font. In that case, only the required characters already used in the PDF can be used. Any other character trying to be used will throw an exception.  
    Public MethodConverts the Page into a string representation.  
    Public MethodOverloaded. Update the TextStyle of a text found in the page. Please note that if the newTextStyle contains a Font from this PDF, it may be an embedded font. In that case, only the required characters already used in the PDF can be updated. Any other character trying to be updated will throw an exception.  
    Top
    Supported Frameworks

    .NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.

    .NET Framework: net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.

    See Also