Search Results for

    Show / Hide Table of Contents

    Class FitToPaperModes

    Behaviors when fitting HTML content to a physical paper size Can affect zoom level and css layout

    Inheritance
    System.Object
    FitToPaperModes
    Namespace: IronPdf.Engines.Chrome
    Assembly: IronPdf.dll
    Syntax
    public sealed class FitToPaperModes : Enum

    Fields

    Automatic

    Measures minimum HTML content width after it is rendered by the browser and calculates Zoom based on the width of the content.

    Zoom and ViewPortWidth have no effect and are calculated automatically by IronPdf.

    Declaration
    public const FitToPaperModes Automatic
    Field Value
    Type Description
    FitToPaperModes
    Remarks

    Useful when fitting a wide content or content of unknown width onto a PDF page

    AutomaticFit

    Measures minimum HTML content width after it is rendered by the browser using the smallest view port possible, and calculates Zoom based on the width of the content.

    Use ViewPortWidth to specify the minimum number of pixels to be fit on each PDF page.

    Zoom has no effect and is calculated automatically by IronPdf.

    Declaration
    public const FitToPaperModes AutomaticFit
    Field Value
    Type Description
    FitToPaperModes
    Remarks

    Useful when fitting smaller content onto a wide page

    FixedPixelWidth

    Fit an exact number of pixels onto each PDF page.

    Uses ViewPortWidth to specify the pixel width to fit on each PDF page.

    Zoom has no effect. Instead, IronPdf will calculate the zoom level based on ViewPortWidth and PaperSize

    Declaration
    public const FitToPaperModes FixedPixelWidth
    Field Value
    Type Description
    FitToPaperModes
    Remarks

    Useful when an optimal pixel width is known or printing documents to match a Chrome browser window display

    None

    Do nothing.

    Default Chrome PDF printing behavior. Uses Zoom to specify zoom level.

    ViewPortWidth has no effect. Instead, Chrome will automatically set the view port based on PaperSize.

    Use CssMediaType to specify CSS media style.
    Declaration
    public const FitToPaperModes None
    Field Value
    Type Description
    FitToPaperModes
    Remarks

    Useful when using 'print' CSS media style or printing documents to match the Chrome browser print preview.

    value__

    Declaration
    public int value__
    Field Value
    Type Description
    System.Int32
    ☀
    ☾
    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.