Search Results for

    Show / Hide Table of Contents

    Namespace IronPdf

    Classes

    AFRelationship

    Defines relationship between embedded file and PDF/A document. Specifies how the attachment relates to the main document content.

    // Invoice XML as alternative representation:
    var config = new EmbedFileConfiguration(EmbedFileType.xml) {
        AFRelationship = AFRelationship.Alternative,
        AFDesc = "Structured invoice data"
    };
    
    // Raw data file:
    var dataConfig = new EmbedFileConfiguration(EmbedFileType.pdf) {
        AFRelationship = AFRelationship.Data
    };
    
    // Source document:
    var sourceConfig = new EmbedFileConfiguration(EmbedFileType.pdf) {
        AFRelationship = AFRelationship.Source,
        AFDesc = "Original document before conversion"
    };

    Alternative = machine-readable version (XML invoices)

    Relationship affects PDF/A compliance validation

    See: https://ironpdf.com/how-to/pdfa/

    AspxToPdf

    One-line PDF conversion for ASP.NET WebForms - transforms any ASPX page into PDF instantly. Add to Page_Load event for automatic PDF rendering instead of HTML output.

    // In your ASPX.cs code-behind:
    protected void Page_Load(object sender, EventArgs e) {
        // Convert this page to PDF automatically:
        AspxToPdf.RenderThisPageAsPdf();
    
        // Download as attachment:
        AspxToPdf.RenderThisPageAsPdf(
            FileBehavior.Attachment,
            "invoice.pdf");
    
        // Custom options:
        var options = new ChromePdfRenderOptions {
            MarginTop = 10,
            PaperSize = PdfPaperSize.A4
        };
        AspxToPdf.RenderThisPageAsPdf(
            FileBehavior.InBrowser,
            "report.pdf",
            options);
    }

    Requires IronPdf.Extensions.ASPX NuGet package

    Only for .NET Framework - use MVC for .NET Core

    See: https://www.nuget.org/packages/IronPdf.Extensions.ASPX/

    See: https://ironpdf.com/how-to/aspx-to-pdf/

    AspxToPdf.FileBehavior

    Determines the web browser behavior towards a PDF document.

    BlockExtractionResult

    Result of block extraction operation in CSS parsing

    BlockSearchResult

    Result of block search operation in CSS parsing

    ChromeClientAccessor

    Accesses Chrome client implementations

    ChromeHttpLoginCredentials

    Provides credentials for IronPdf's embedded Chrome browser to log-in to an intranet, extranet or website, impersonating a user. This allows a unique ability to render web-pages as PDFs even on secure intranets, extranets and websites.

    ChromePdfRenderer

    Creates professional PDF documents from HTML using the actual Chrome browser engine for pixel-perfect accuracy. Unlike competitors using webkit or custom parsers, IronPDF renders exactly what Chrome's print preview shows.

    ChromePdfRenderOptions

    Html To PDF output options for . Specifies options such as Paper-Size, DPI, Headers and Footers and other Chromium specific browser setup options.

    Cleaner

    The Cleaner class can be used to scan or sanitize (remove any potentially harmful content) PDF document.

    CleanerScanResult

    Contains the results of a PDF security scan, indicating detected threats and malware signatures. Returned by ScanPdf(PdfDocument, String[]) and related scanning methods.

    Example - Check scan results:

    var pdf = PdfDocument.FromFile("untrusted.pdf");
    var result = Cleaner.ScanPdf(pdf);
    

    if (result.IsDetected) { Console.WriteLine($"THREATS FOUND: {result.Risks.Count}"); foreach (var risk in result.Risks) Console.WriteLine($" - {risk}"); // Do not process this PDF } else { Console.WriteLine("PDF is clean"); // Safe to process }

    CompressionOptions

    Configuration options for reducing PDF file size through compression. Controls image quality, structural data, and compression algorithms for optimal size/quality balance.

    Example - Optimize PDF for different use cases:

    // Maximum compression for email/web (smaller file, lower quality):
    var webOptions = new CompressionOptions
    {
        CompressImages = true,
        ShrinkImages = true,
        JpegQuality = 60,
        HighQualityImageSubsampling = false,
        RemoveStructureTree = true
    };
    pdf.Compress(webOptions);  // Can reduce 10MB to ~2MB
    

    // Balanced compression for general distribution: var balancedOptions = new CompressionOptions { CompressImages = true, ShrinkImages = true, JpegQuality = 80, HighQualityImageSubsampling = true, RemoveStructureTree = false // Preserve text selection }; pdf.Compress(balancedOptions);

    // Quality-first compression for archival: var archiveOptions = new CompressionOptions { CompressImages = true, ShrinkImages = false, // Keep original resolution JpegQuality = 95, HighQualityImageSubsampling = true, RemoveStructureTree = false }; pdf.Compress(archiveOptions);

    ConformanceLevel

    Conformance level of embedding XML file applying to XMP Metadata

    CssDeclaration

    Represents a parsed CSS declaration with its components

    CssToken

    Represents a CSS token with its type and value

    CssTokenType

    Types of CSS tokens that can be encountered during parsing

    DocxPdfRenderOptions

    Margin values which can be copied from the main document to headers and footers applied to the document

    DocxToPdfRenderer

    Converts Microsoft Word documents (.docx) to PDF with perfect formatting preservation. Maintains tables, images, headers, footers, styles, and complex layouts exactly as they appear in Word.

    // Simple conversion:
    var renderer = new DocxToPdfRenderer();
    var pdf = renderer.RenderDocxAsPdf("contract.docx");
    pdf.SaveAs("contract.pdf");
    
    // With custom margins:
    var options = new DocxPdfRenderOptions {
        MarginTop = 20,
        MarginBottom = 20,
        PaperSize = PdfPaperSize.Letter
    };
    var pdf = renderer.RenderDocxAsPdf("report.docx", options);
    
    // From stream (web upload):
    using (var stream = uploadedFile.OpenReadStream()) {
        var pdf = renderer.RenderDocxAsPdf(stream);
        pdf.SaveAs($"converted_{uploadedFile.FileName}.pdf");
    }

    Preserves Word formatting better than Office interop or OpenXML

    Only supports .docx format (not .doc legacy format)

    See: https://ironpdf.com/how-to/docx-to-pdf/

    EmbedFileByte

    Struct for storing byte[] of embedding file with configuration

    EmbedFileConfiguration

    Configuration of EmbedFilePath, EmbedFileByte, or EmbedFileStream when converting PdfDocument to PDF/A-3 document with embedding files

    Specifying type of embeddding file, file name, and custom of XMP Metadata

    EmbedFilePath

    Struct for storing path directory of embedding file with configuration

    EmbedFileStream

    Struct for storing Stream of embedding file with configuration

    EmbedFileType

    Supported file types for embedding in PDF/A-3 compliant documents. Essential for creating invoice PDFs with structured data attachments.

    // Embed invoice XML (ZUGFeRD/Factur-X):
    var xmlConfig = new EmbedFileConfiguration(EmbedFileType.xml) {
        EmbedFileName = "invoice_2024.xml"
    };
    var embedPath = new EmbedFilePath("invoice.xml", xmlConfig);
    
    // Attach source PDF:
    var pdfConfig = new EmbedFileConfiguration(EmbedFileType.pdf);
    
    // Include logo image:
    var pngConfig = new EmbedFileConfiguration(EmbedFileType.png);

    XML for structured invoice data (ZUGFeRD/Factur-X)

    Only PDF/A-3 and PDF/A-4F support embedded files

    See: https://ironpdf.com/how-to/pdfa/

    HtmlFormatOptions

    This class contains properties that define the formatting options for converting PDF to HTML.

    HtmlHeaderFooter

    A HTML Header or Footer which will be printed onto every page of the PDF. This can be used to override

    When using HtmlHeaderFooter it is important to set HtmlFragment

    Merge meta-data into your HTML using any of these placeholder strings: {page} {total-pages} {url} {date} {time} {html-title} {pdf-title}

    ImageToPdfConverter

    Converts images (PNG, JPG, BMP, GIF, TIFF, SVG) to professional PDF documents instantly. Perfect for digitizing scanned documents, photo albums, certificates, or creating image portfolios.

    // Single image to PDF:
    var pdf = ImageToPdfConverter.ImageToPdf("photo.jpg");
    pdf.SaveAs("photo.pdf");
    
    // Multiple images to multi-page PDF:
    string[] images = { "page1.png", "page2.jpg", "page3.tiff" };
    var document = ImageToPdfConverter.ImageToPdf(images);
    document.SaveAs("album.pdf");
    
    // From bitmap with custom behavior:
    using (var bitmap = AnyBitmap.FromFile("scan.png")) {
        var pdf = ImageToPdfConverter.ImageToPdf(bitmap,
            Imaging.ImageBehavior.CropPage);  // Exact size
    }

    Supports 20+ image formats including PNG, JPG, GIF, BMP, TIFF, SVG, WebP

    For PDF to image conversion, use PdfDocument.ToBitmap() instead

    See: https://ironpdf.com/how-to/image-to-pdf/

    Installation

    One-time global configuration for IronPDF deployment, licensing, and performance tuning. Configure once at application startup before creating any PDF operations for optimal results.

    // Application startup configuration:
    Installation.LicenseKey = "YOUR-LICENSE-KEY";
    Installation.Initialize();  // Warm up rendering engines
    
    // Docker/Linux configuration:
    Installation.LinuxAndDockerDependenciesAutoConfig = true;
    Installation.ChromeGpuMode = ChromeGpuModes.Disabled;
    
    // High-performance server configuration:
    Installation.ChromeBrowserLimit = 20;  // More concurrent browsers
    Installation.TempFolderPath = @"/fast-ssd/temp";  // Fast storage

    Call Initialize() at startup to avoid first-render delays

    Configure before any PDF operations for settings to take effect

    See: https://ironpdf.com/how-to/installation/

    InternalPdfAVersion

    Enumeration of PDF/A profile supported by IronPDF. Order is done according to order already done in IronPdf layer

    LayerMode

    Layering modes for merging documents

    License

    Manages IronPDF licensing - apply your license key once at application startup. Removes watermarks and enables production use with a valid commercial or trial license.

    // Apply license at startup (Program.cs or Global.asax):
    License.LicenseKey = "IRONPDF-MYLICENSE-KEY-1EF01";
    
    // Verify licensing status:
    if (License.IsLicensed) {
        Console.WriteLine("IronPDF is licensed and ready!");
    }
    
    // Alternative: Use config files
    // App.config or Web.config:
    // <appSettings>
    //   <add key="IronPdf.LicenseKey" value="YOUR-KEY"/>
    // </appSettings>
    
    // appsettings.json (.NET Core):
    // {
    //   "IronPdf.LicenseKey": "YOUR-KEY"
    // }

    Set license key once at application startup

    Watermarks appear without valid license in production

    See: https://ironpdf.com/licensing/

    See: https://ironpdf.com/docs/license/license-keys/

    NaturalLanguages

    Specifies document language for PDF/UA accessibility compliance and screen reader support. Essential for creating accessible PDFs that work with assistive technologies globally.

    // English accessible PDF:
    pdf.ConvertToPdfUA(PdfUAVersions.PdfUA1, NaturalLanguages.English);
    
    // Spanish document with accessibility:
    pdf.ConvertToPdfUA(PdfUAVersions.PdfUA1, NaturalLanguages.Spanish);
    
    // Multi-language support:
    var language = userLocale switch {
        "es" => NaturalLanguages.Spanish,
        "fr" => NaturalLanguages.French,
        "de" => NaturalLanguages.German,
        "zh" => NaturalLanguages.ChineseSimplified,
        _ => NaturalLanguages.English
    };
    pdf.ConvertToPdfUA(PdfUAVersions.PdfUA1, language);

    Language setting helps screen readers pronounce content correctly

    Required for Section 508 and W3C WCAG compliance

    See: https://ironpdf.com/how-to/pdfua/#language-settings

    PdfAttachment

    Represents a file attachment embedded within a PDF document. Provides access to attachment metadata and binary data for extraction or modification.

    PDF attachments are complete files stored within the PDF container. They appear as paperclip icons in PDF readers and can contain any file type (spreadsheets, images, documents, etc.).

    Example - Extract attachment to disk:

    var pdf = PdfDocument.FromFile("invoice_with_receipt.pdf");
    foreach (var attachment in pdf.Attachments)
    {
        Console.WriteLine($"Found: {attachment.Name} at index {attachment.Index}");
        File.WriteAllBytes(attachment.Name, attachment.Data);
    }

    PdfAttachmentCollection

    Manages the collection of file attachments embedded in a PDF document. Supports adding, removing, and iterating through attachments.

    Access this collection via Attachments property.

    Example - Manage attachments:

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

    // Add attachment: byte[] excelData = File.ReadAllBytes("report.xlsx"); pdf.Attachments.AddAttachment("Q4_Report.xlsx", excelData);

    // List all attachments: foreach (var att in pdf.Attachments) Console.WriteLine($"{att.Index}: {att.Name}");

    // Remove first attachment: pdf.Attachments.RemoveAttachment(pdf.Attachments[0]);

    pdf.SaveAs("modified.pdf");

    PdfAVersions

    PDF/A archival standard versions for long-term document preservation. Ensures documents remain viewable for decades with embedded fonts and metadata.

    // Most common - supports attachments:
    pdf.ConvertToPdfA(PdfAVersions.PdfA3b);
    
    // Basic archival (no attachments):
    pdf.ConvertToPdfA(PdfAVersions.PdfA1b);
    
    // With accessibility (screen reader support):
    pdf.ConvertToPdfA(PdfAVersions.PdfA2a);
    
    // Modern standard with embedded files:
    pdf.ConvertToPdfA(PdfAVersions.PdfA4f);

    "B" = Basic compliance, "A" = Accessibility compliance

    PDF/A-3 and PDF/A-4F support file attachments, others do NOT

    See: https://ironpdf.com/how-to/pdfa/

    PdfClientAccessor

    Accesses PDF client implementations

    PdfDocument

    Represents a PDF document with full manipulation capabilities - merge, split, edit, secure, and save. This is your PDF after rendering - now you can modify it, add security, extract content, or save to disk.

    PdfDocumentExtensions

    Extension methods for PdfDocument class

    PdfHyphenationLanguage

    Specifies the language to use for the hyphenation. The property must be set to a value other than None to be activated.

    PdfUAVersions

    Enumeration of PDF/UA versions supported by IronPDF.

    PixelFormat

    Specifies the format of the color data for each pixel in the image.

    PropertyVersion

    Property Version of embedding XML file applying to XMP Metadata

    SchemaNamespace

    PDF/A Schema NamespaceURI of embedding XML file appyling to XMP Metadata

    SchemaPrefix

    PDF/A Schema Prefix of embbedding XML file applying to XMP Metadata

    TableOfContentsTypes

    Table of contents layout type

    TextAlignment

    Represents the text alignment options for the title (h1) in the HTML document.

    TextExtractionOrder

    Strategy for determining word order when extracting text from PDFs. Controls how text is read from complex layouts like columns, tables, or edited documents.

    // Extract from multi-column newsletter:
    string columns = pdf.ExtractAllText(TextExtractionOrder.LogicalOrder);
    // Reads: Column 1 top to bottom, then Column 2 top to bottom
    
    // Extract from heavily edited document:
    string visual = pdf.ExtractAllText(TextExtractionOrder.VisualOrder);
    // Reads: Left to right, top to bottom as displayed
    
    // Choose based on document type:
    var order = pdf.PageCount > 50
        ? TextExtractionOrder.LogicalOrder  // Books, reports
        : TextExtractionOrder.VisualOrder;  // Forms, invoices
    string text = pdf.ExtractAllText(order);

    See: https://ironpdf.com/how-to/extract-text/

    TextHeaderFooter

    Defines PDF Header and Footer display options.

    TextHeaderFooter uses a logical approach to rendering Headers and Footers for the most common use cases.

    UseMargins

    Margin values which can be copied from the main document to headers and footers applied to the document

    Interfaces

    IMargins

    Document margin values, in millimeters

    IPdfRenderOptions

    Defines the contract for all PDF rendering options - the blueprint for HTML to PDF conversion settings. Implemented by ChromePdfRenderOptions and other render option classes for consistent configuration.

    // All render option classes implement this interface:
    IPdfRenderOptions options = new ChromePdfRenderOptions {
        PaperSize = PdfPaperSize.A4,
        MarginTop = 20,
        MarginBottom = 20,
        PrintHtmlBackgrounds = true,
        EnableJavaScript = true
    };
    
    // Use interface for flexible option handling:
    public void ConfigurePdf(IPdfRenderOptions options) {
        options.PaperOrientation = PdfPaperOrientation.Landscape;
        options.DPI = 300;  // High quality
        options.GrayScale = false;  // Color output
    }
    
    // Clone options for variations:
    var draftOptions = (IPdfRenderOptions)options.Clone();
    draftOptions.JpegQuality = 60;  // Lower quality for drafts

    Use this interface for polymorphic option handling

    Not all options apply to every rendering context

    See: https://ironpdf.com/object-reference/api/IronPdf.IPdfRenderOptions.html

    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget
    Want to deploy IronPDF to a live project for FREE?
    What’s included?
    30 days of fully-functional product
    Test and share in a live environment
    No watermarks in production
    Get your free 30-day Trial Key instantly.
    No credit card or account creation required
    Your Trial License Key has been emailed to you.
    Download IronPDF free to apply
    your Trial Licenses Key
    Install with NuGet View Licenses
    Licenses from $499. Have a question? Get in touch.