Enumeration FitToPaperModes

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

Enumeration Members

ContinuousFeed: 4

Creates a single page PDF which will force its entire content's width and height to fit into one page. Can be used for a consumer bill or receipt.

Useful when printing bill or receipt

Default: 0

Do nothing. Default Chrome PDF printing behavior. Uses ChromePdfRenderOptions.zoom to specify zoom level. ChromePdfRenderOptions.viewPortWidth has no effect.

Instead, Chrome will automatically set the view port based on paperSize. Use cssMediaType to specify CSS media style.

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

FitToHeight: 2

Measures minimum HTML content width after it is rendered by the browser and calculates ChromePdfRenderOptions.zoom based on the width of the content. ChromePdfRenderOptions.zoom and ChromePdfRenderOptions.viewPortWidth have no effect and are calculated automatically by IronPdf.

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

FitToPage: 3

Measures minimum HTML content width after it is rendered by the browser using the smallest view port possible, and calculates ChromePdfRenderOptions.zoom based on the width of the content. Use ChromePdfRenderOptions.viewPortWidth to specify the minimum number of pixels to be fit on each PDF page. ChromePdfRenderOptions.zoom has no effect and is calculated automatically by IronPdf.

Useful when fitting smaller content onto a wide page

FitToWidth: 1

Fit an exact number of pixels onto each PDF page. Uses ChromePdfRenderOptions.viewPortWidth to specify the pixel width to fit on each PDF page. ChromePdfRenderOptions.zoom has no effect. Instead, IronPdf will calculate the zoom level based on ChromePdfRenderOptions.viewPortWidth and paperSize

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

Generated using TypeDoc