public class ChromePdfRenderOptions extends Object implements Cloneable
Render_Api. Specify options such as Paper-Size, DPI,
and other Chromium specific browser setup options.| Constructor and Description |
|---|
ChromePdfRenderOptions() |
| Modifier and Type | Method and Description |
|---|---|
Object |
Clone()
Supports
Cloneable. |
CssMediaType |
getCssMediaType()
Gets css media type.
|
String |
getCustomCssUrl()
Gets custom css url.
|
double |
getCustomPaperHeight()
Gets custom paper height.
|
double |
getCustomPaperWidth()
Gets custom paper width (mm).
|
FitToPaperModes |
getFitToPaperMode()
use one of these method instead
UseChromeDefaultRendering()
UseScaledRendering()
UseResponsiveCssRendering()
UseFitToPageRendering() |
String |
getInputEncoding()
Gets input character encoding as a string;
e.g.
|
String |
getJavascript()
Get A custom javascript string to be executed after all HTML has loaded but before PDf rendering.
|
double |
getMarginBottom()
Gets margin bottom.
|
double |
getMarginLeft()
Gets margin left.
|
double |
getMarginRight()
Gets margin right.
|
double |
getMarginTop()
Gets margin top.
|
PaperOrientation |
getPaperOrientation()
Gets paper orientation.
|
PaperSize |
getPaperSize()
Gets paper size.
|
TableOfContentsTypes |
getTableOfContents()
Gets TableOfContents.
|
int |
getTimeout()
Gets render timeout in seconds.
|
String |
getTitle()
Gets title.
|
int |
getViewPortHeight()
internal use
|
int |
getViewPortWidth()
internal use
|
WaitFor |
getWaitFor()
Gets a wrapper object that holds configuration for wait-for mechanism for user to wait for certain events before rendering.
|
int |
getZoom()
internal use
|
boolean |
isCreatePdfFormsFromHtml()
Is create pdf forms from html.
|
boolean |
isEnableJavaScript()
Is enable JavaScript.
|
boolean |
isGrayScale()
Is gray scale boolean.
|
boolean |
isPrintHtmlBackgrounds()
Is print html backgrounds boolean.
|
void |
setCreatePdfFormsFromHtml(boolean value)
Sets create pdf forms from html.
|
void |
setCssMediaType(CssMediaType value)
Sets css media type.
|
void |
setCustomCssUrl(String value)
Sets custom css url.
|
void |
setCustomPaperHeight(double value)
Sets custom paper height (mm).
|
void |
setCustomPaperSizeInCentimeters(double width,
double height)
Set an output paper size for PDF pages.
|
void |
SetCustomPaperSizeInInches(double width,
double height)
Set an output paper size for PDF pages.
|
void |
setCustomPaperSizeInMillimeters(double width,
double height)
Set an output paper size for PDF pages.
|
void |
setCustomPaperSizeInPixelsOrPoints(double width,
double height)
Set an output paper size for PDF pages.
|
void |
setCustomPaperSizeInPixelsOrPoints(double width,
double height,
int DPI)
Set an output paper size for PDF pages.
|
void |
setCustomPaperWidth(double value)
Sets custom paper width (mm).
|
void |
setEnableJavaScript(boolean value)
Sets enable JavaScript.
|
void |
setFitToPaperMode(FitToPaperModes value)
Deprecated.
use one of these method instead
UseChromeDefaultRendering()
UseScaledRendering()
UseResponsiveCssRendering()
UseFitToPageRendering() |
void |
setGrayScale(boolean value)
Sets gray scale.
|
void |
setInputEncoding(String value)
Sets input character encoding as a string;
e.g.
|
void |
setJavascript(String javascript)
Set A custom javascript string to be executed after all HTML has loaded but before PDf rendering.
|
void |
setMarginBottom(double value)
Sets margin bottom.
|
void |
setMarginLeft(double value)
Sets margin left.
|
void |
setMarginRight(double value)
Sets margin right.
|
void |
setMarginTop(double value)
Sets margin top.
|
void |
setPaperOrientation(PaperOrientation value)
Sets paper orientation.
|
void |
setPaperSize(PaperSize value)
Sets paper size.
|
void |
setPrintHtmlBackgrounds(boolean value)
Sets print html backgrounds.
|
void |
setTableOfContents(TableOfContentsTypes value)
Sets TableOfContents.
|
void |
setTimeout(int timeout)
Sets render timeout in seconds.
|
void |
setTitle(String value)
Sets title.
|
void |
setWaitFor(WaitFor waitFor)
Sets a wrapper object that holds configuration for wait-for mechanism for user to wait for certain events before rendering.
|
void |
UseChromeDefaultRendering()
Lays out PDF pages in the same way as when viewed from Google Chrome's print preview.
|
void |
UseContinuousFeedRendering()
Creates a single page PDF which will force its entire content's width and height to fit into one page.
|
void |
UseContinuousFeedRendering(double width)
Creates a single page PDF which will force its entire content's width and height to fit into one page.
|
void |
UseContinuousFeedRendering(double width,
int margin)
Creates a single page PDF which will force its entire content's width and height to fit into one page.
|
void |
UseContinuousFeedRendering(int margin)
Creates a single page PDF which will force its entire content's width and height to fit into one page.
|
void |
UseFitToPageRendering()
Scales content to fit the specified
setPaperSize(PaperSize). |
void |
UseFitToPageRendering(int minimumPixelWidth)
Scales content to fit the specified
setPaperSize(PaperSize). |
void |
UseResponsiveCssRendering()
Uses Responsive CSS to define the rendering of the HTML based on the ViewPortWidth parameter.
|
void |
UseResponsiveCssRendering(int viewPortWidthValue)
Uses Responsive CSS to define the rendering of the HTML based on the ViewPortWidth parameter.
|
void |
UseScaledRendering()
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.
|
void |
UseScaledRendering(int zoomPercentage)
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.
|
public boolean isCreatePdfFormsFromHtml()
public void setCreatePdfFormsFromHtml(boolean value)
value - the valuepublic CssMediaType getCssMediaType()
Note: By setting AllowScreenCss=false, IronPdf renders PDFs from HTML using CSS for media="print" as if printing a web page in a browser print dialog.
public void setCssMediaType(CssMediaType value)
Note: By setting AllowScreenCss=false, IronPdf renders PDFs from HTML using CSS for media="print" as if printing a web page in a browser print dialog.
value - the valuepublic String getCustomCssUrl()
public void setCustomCssUrl(String value)
value - the valuepublic double getCustomPaperHeight()
public void setCustomPaperHeight(double value)
value - the valuepublic double getCustomPaperWidth()
public void setCustomPaperWidth(double value)
value - the valuepublic boolean isEnableJavaScript()
Also see waitFor
public void setEnableJavaScript(boolean value)
Also see waitFor
value - the valuepublic FitToPaperModes getFitToPaperMode()
UseChromeDefaultRendering()
UseScaledRendering()
UseResponsiveCssRendering()
UseFitToPageRendering()public void setFitToPaperMode(FitToPaperModes value)
UseChromeDefaultRendering()
UseScaledRendering()
UseResponsiveCssRendering()
UseFitToPageRendering()public boolean isGrayScale()
public void setGrayScale(boolean value)
value - the valuepublic String getInputEncoding()
public void setInputEncoding(String value)
value - e.g. "utf-8", "utf-16", "ASCII" or elsepublic double getMarginBottom()
public void setMarginBottom(double value)
value - the valuepublic double getMarginLeft()
public void setMarginLeft(double value)
value - the valuepublic double getMarginRight()
public void setMarginRight(double value)
value - the valuepublic double getMarginTop()
public void setMarginTop(double value)
value - the valuepublic PaperOrientation getPaperOrientation()
public void setPaperOrientation(PaperOrientation value)
value - the valuepublic PaperSize getPaperSize()
Use
setCustomPaperSizeInMillimeters(double, double), setCustomPaperSizeInPixelsOrPoints(double, double), etc... for custom sizes.
public void setPaperSize(PaperSize value)
Use
setCustomPaperSizeInMillimeters(double, double), setCustomPaperSizeInPixelsOrPoints(double, double), etc... for custom sizes.
value - the valuepublic boolean isPrintHtmlBackgrounds()
public void setPrintHtmlBackgrounds(boolean value)
value - the valuepublic String getTitle()
public void setTitle(String value)
value - the valuepublic String getJavascript()
public Object Clone() throws CloneNotSupportedException
Cloneable. Creates a deep copy of this class instance.CloneNotSupportedException - the clone not supported exceptionpublic void setCustomPaperSizeInCentimeters(double width,
double height)
width - Custom paper width in cm.height - Custom paper height in cm.public void setCustomPaperSizeInMillimeters(double width,
double height)
width - Custom paper width in millimeters.height - Custom paper height in millimeters.public void setCustomPaperSizeInPixelsOrPoints(double width,
double height)
width - Custom paper width in pixels/points.height - Custom paper height in pixels/points..public void setCustomPaperSizeInPixelsOrPoints(double width,
double height,
int DPI)
width - Custom paper width in pixels/points.height - Custom paper height in pixels/points.DPI - Intended print resolution of the PDF. To be clear PDFs have no fixed DPI/PPI value for rendering. 72 and 96 are common onscreen values. 300 is a common value used in commercial printing.public void SetCustomPaperSizeInInches(double width,
double height)
width - Custom paper width in Inches.height - Custom paper height in Inches.public void setJavascript(String javascript)
javascript - a javascript string.public WaitFor getWaitFor()
public void setWaitFor(WaitFor waitFor)
public int getTimeout()
public void setTimeout(int timeout)
public int getViewPortWidth()
public int getViewPortHeight()
public int getZoom()
public void UseChromeDefaultRendering()
setPaperSize(PaperSize).
To change this responsive behavior use UseResponsiveCssRendering()public void UseScaledRendering()
setPaperSize(PaperSize) Specified Paper Sizepublic void UseScaledRendering(int zoomPercentage)
setPaperSize(PaperSize) Specified Paper SizezoomPercentage - A percentage based scale factor on the HTML document.public void UseResponsiveCssRendering()
setPaperSize(PaperSize) Specified Paper Size
Set setCssMediaType(com.ironsoftware.ironpdf.render.CssMediaType) to choose between paper and screen CSS interpretations.public void UseResponsiveCssRendering(int viewPortWidthValue)
setPaperSize(PaperSize) Specified Paper Size
Set setCssMediaType(com.ironsoftware.ironpdf.render.CssMediaType) to choose between paper and screen CSS interpretations.viewPortWidthValue - A pixel based virtual browser viewport for responsive CSS designs.public void UseFitToPageRendering()
setPaperSize(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.public void UseFitToPageRendering(int minimumPixelWidth)
setPaperSize(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.minimumPixelWidth - A pixel based minimum with for the document. Can help HTML elements to display correctly and respond appropriately to CSS3 responsive layout rules.public void UseContinuousFeedRendering()
public void UseContinuousFeedRendering(int margin)
margin - The margin in millimeters to apply to the PDF page. Default is 5public void UseContinuousFeedRendering(double width)
width - The width in millimeters to apply to the PDF page. Default is 80public void UseContinuousFeedRendering(double width,
int margin)
width - The width in millimeters to apply to the PDF page. Default is 80margin - The margin in millimeters to apply to the PDF page. Default is 5public TableOfContentsTypes getTableOfContents()
public void setTableOfContents(TableOfContentsTypes value)
value - the valueCopyright © 2022–2025 Iron Software. All rights reserved.