Class FitToPaperModes
Behaviors when fitting HTML content to a physical paper size Can affect zoom level and css layout
Inheritance
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 |