Search Results for

    Show / Hide Table of Contents

    Namespace IronPdf.Pages

    Classes

    LineTextObject

    Represents a single line of text within a PDF page, combining multiple text chunks. Provides access to line content, bounding box, and positioning information.

    Lines are derived from TextChunks by grouping text objects that appear on the same visual line based on their vertical position.

    Example - Extract lines from a page:

    var pdf = PdfDocument.FromFile("document.pdf");
    var page = pdf.Pages[0] as PdfPage;
    

    foreach (var line in page.Lines) { Console.WriteLine($"Line: {line.Contents}"); Console.WriteLine($"Position: ({line.BoundingBox.Left}, {line.BoundingBox.Top})"); }

    PdfPage

    Represents a single page within a PDF document with access to dimensions, content, and manipulation methods. Provides properties for width, height, rotation, text extraction, and page transformation.

    Access pages via Pages collection. Each page provides access to text content, dimensions, and methods for resizing and transforming content.

    Example - Work with PDF pages:

    var pdf = PdfDocument.FromFile("document.pdf");
    

    // Access page properties: var page = pdf.Pages[0] as PdfPage; Console.WriteLine($"Size: {page.Width}mm x {page.Height}mm"); Console.WriteLine($"Rotation: {page.PageRotation}"); Console.WriteLine($"Text: {page.Text}");

    // Resize page: page.Resize(210, 297); // A4 size in mm

    // Extend page margins: page.Extend(10, 10, 20, 20); // Add margins (left, right, top, bottom)

    // Transform content: page.Transform(5, -5, 1.0, 1.0); // Move content 5mm right, 5mm down

    PdfPageModel

    Represents the document object model (DOM) for a single PDF page. Provides access to text, image, and path objects for content analysis and extraction.

    This class exposes the internal structure of a PDF page, allowing programmatic access to individual content elements. Use for content extraction, analysis, or understanding page composition.

    Example - Analyze page content:

    var pdf = PdfDocument.FromFile("document.pdf");
    var pageModel = pdf.Pages[0].GetPageModel();
    

    // Count content elements: Console.WriteLine($"Images: {pageModel.ImageObjects.Count}"); Console.WriteLine($"Text blocks: {pageModel.TextObjects.Count}"); Console.WriteLine($"Paths/shapes: {pageModel.PathObjects.Count}");

    // Get page dimensions: var bounds = pageModel.BoundingBox; Console.WriteLine($"Page size: {bounds.Width} x {bounds.Height} points");

    // Export to JSON: string json = pageModel.ToJson();

    PdfPagesCollection

    Manages the collection of pages within a PDF document. Supports iteration, addition, removal, and direct access to individual pages.

    Access this collection via Pages property. The collection provides full control over document structure including page manipulation.

    Example - Work with pages:

    var pdf = PdfDocument.FromFile("document.pdf");
    

    // Iterate pages: foreach (var page in pdf.Pages) Console.WriteLine($"Page {page.PageIndex}: {page.Width}x{page.Height}");

    // Access specific page: var firstPage = pdf.Pages[0]; var lastPage = pdf.Pages[pdf.PageCount - 1];

    // Remove page: pdf.Pages.RemoveAt(2); // Remove page 3

    // Get page count: int totalPages = pdf.Pages.Count;

    Interfaces

    IPdfPage

    PDF document page interface

    IPdfPageCollection

    Collection of PDF pages

    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget
    IronPDF_for_dotnet_log2o
    Blue key in circleGet started for FREE
    No credit card required
    Test in a live environment

    Test in production without watermarks.
    Works wherever you need it to.

    Fully-functional product

    Get 30 days of fully functional product.
    Have it up and running in minutes.

    24/5 technical support

    Full access to our support engineering team during your product trial

    Grey key in circleGet started for FREE
    The trial form was submitted successfully.
    Calendar in circleBook Free Live Demo
    No contact, no card details, no commitments Book a 30-minute, personal demo.
    Here's what to expect:

    A live demo of our product and its key features

    Get project specific feature recommendations

    All your questions are answered to make sure you have all the information you need. (No commitment whatsoever.)

    Grey key in circleBook Free Live Demo
    Your booking has been completed Check your e-mail for confirmation
    Support Team Member 6 related to The C# PDF Library Support Team Member 14 related to The C# PDF Library Support Team Member 4 related to The C# PDF Library Support Team Member 2 related to The C# PDF Library
    Online 24/5
    Need help? Our sales team would be glad to help you.
    Try the Enterprise Trial
    ironpdf_for_dotnet_log2o
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    bullet_checkedNo credit card or account creation required
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    Blue key in circleNo credit card or account creation required
    Green Check in orange circle
    The trial form was submitted successfully.
    badge_greencheck_in_yellowcircle
    Thank you for starting a trial

    Please check your email for the trial license key.

    If you don’t receive an email, please start a live chat or email support@ironsoftware.com

    Install with NuGet
    View Licensing
    • Logo Aetna
    • Logo NASA
    • Logo GE
    • Logo Porsche
    • Logo USDA
    • Logo Qatar
    Join Millions of Engineers who’ve tried IronPDF