Class VirtualPaperLayoutManager
Manages HtmlToPdf page layout behavior when rendering HTML to virtual PDF paper.
Provides options for Responsive CSS, Zoom, Fit-To-Page and Continuous feed printing options that are not available in standard Chrome.
Only one option may be selected at a time.
Inheritance
Namespace: IronPdf.Engines.Chrome
Assembly: IronPdf.dll
Syntax
public class VirtualPaperLayoutManager : Object
Methods
UseChromeDefaultRendering()
Lays out PDF pages in the same way as when viewed from Google Chrome's print preview.
Responsive CSS viewport is interpreted based on the width of the Specified Paper Size. To change this responsive behavior use UseResponsiveCssRendering(Int32)
Declaration
public void UseChromeDefaultRendering()
UseContinuousFeedRendering(Int32)
Creates a simple page PDF of fixed width, with all content on a single page. This is useful for continuous feed paper options such as receipt printing. Scales content horizontally to fit the Specified Paper Size Width. The paper Height is ignored.
Declaration
public void UseContinuousFeedRendering(int ViewPortWidth = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | ViewPortWidth | A pixel based virtual browser viewport for responsive CSS designs. |
UseFitToPageRendering(Int32)
Scales content to fit the specified PaperSize. This mode measures minimum HTML content width after it is rendered by the browser, and then scales that content to fit to 1 sheet of paper wide where possible.
A minimum width can be set to control scaling and also to ensure that responsive CSS rules are correctly applied.
Declaration
public void UseFitToPageRendering(int MinimumPixelWidth = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | MinimumPixelWidth | A pixel based minimum with for the document. Can help HTML elements to display correctly and respond appropriately to CSS3 responsive layout rules. |
UseResponsiveCssRendering(Int32)
Uses Responsive CSS to define the rendering of the HTML based on the ViewPortWidth parameter.
Content will attempt to scale the rendered content content to fill the width of the Specified Paper Size.
\Set CssMediaType to choose between paper and screen CSS interpretations.
Declaration
public void UseResponsiveCssRendering(int ViewPortWidth = 1280)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | ViewPortWidth | A pixel based virtual browser viewport for responsive CSS designs. |
UseScaledRendering(Int32)
Adopts a layout which behaves in the same way the 'Chrome Print Preview' does for a given paper size, with an additional zoom level applied to allow content to be manually scaled by the developer.
Responsive CSS is interpreted based on the width of the Specified Paper Size
Declaration
public void UseScaledRendering(int ZoomPercentage = 100)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | ZoomPercentage | A percentage based scale factor on the HTML document. |