Package com.ironsoftware.ironpdf.render
Class ChromePdfRenderOptions
- java.lang.Object
- 
- com.ironsoftware.ironpdf.render.ChromePdfRenderOptions
 
- 
- All Implemented Interfaces:
- Cloneable
 
 public class ChromePdfRenderOptions extends Object implements Cloneable Html To PDF output options forRender_Api. Specify options such as Paper-Size, DPI, and other Chromium specific browser setup options.
- 
- 
Constructor SummaryConstructors Constructor Description ChromePdfRenderOptions()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ObjectClone()SupportsCloneable.CssMediaTypegetCssMediaType()Gets css media type.StringgetCustomCssUrl()Gets custom css url.doublegetCustomPaperHeight()Gets custom paper height.doublegetCustomPaperWidth()Gets custom paper width (mm).FitToPaperModesgetFitToPaperMode()use one of these method insteadUseChromeDefaultRendering()UseScaledRendering()UseResponsiveCssRendering()UseFitToPageRendering()StringgetInputEncoding()Gets input character encoding as a string; e.g.StringgetJavascript()Get A custom javascript string to be executed after all HTML has loaded but before PDf rendering.doublegetMarginBottom()Gets margin bottom.doublegetMarginLeft()Gets margin left.doublegetMarginRight()Gets margin right.doublegetMarginTop()Gets margin top.PaperOrientationgetPaperOrientation()Gets paper orientation.PaperSizegetPaperSize()Gets paper size.TableOfContentsTypesgetTableOfContents()Gets TableOfContents.StringgetTitle()Gets title.intgetViewPortHeight()internal useintgetViewPortWidth()internal useWaitForgetWaitFor()Gets a wrapper object that holds configuration for wait-for mechanism for user to wait for certain events before rendering.intgetZoom()internal usebooleanisCreatePdfFormsFromHtml()Is create pdf forms from html.booleanisEnableJavaScript()Is enable JavaScript.booleanisGrayScale()Is gray scale boolean.booleanisPrintHtmlBackgrounds()Is print html backgrounds boolean.voidsetCreatePdfFormsFromHtml(boolean value)Sets create pdf forms from html.voidsetCssMediaType(CssMediaType value)Sets css media type.voidsetCustomCssUrl(String value)Sets custom css url.voidsetCustomPaperHeight(double value)Sets custom paper height (mm).voidsetCustomPaperSizeInCentimeters(double width, double height)Set an output paper size for PDF pages.voidSetCustomPaperSizeInInches(double width, double height)Set an output paper size for PDF pages.voidsetCustomPaperSizeInMillimeters(double width, double height)Set an output paper size for PDF pages.voidsetCustomPaperSizeInPixelsOrPoints(double width, double height)Set an output paper size for PDF pages.voidsetCustomPaperSizeInPixelsOrPoints(double width, double height, int DPI)Set an output paper size for PDF pages.voidsetCustomPaperWidth(double value)Sets custom paper width (mm).voidsetEnableJavaScript(boolean value)Sets enable JavaScript.voidsetFitToPaperMode(FitToPaperModes value)Deprecated.use one of these method insteadUseChromeDefaultRendering()UseScaledRendering()UseResponsiveCssRendering()UseFitToPageRendering()voidsetGrayScale(boolean value)Sets gray scale.voidsetInputEncoding(String value)Sets input character encoding as a string; e.g.voidsetJavascript(String javascript)Set A custom javascript string to be executed after all HTML has loaded but before PDf rendering.voidsetMarginBottom(double value)Sets margin bottom.voidsetMarginLeft(double value)Sets margin left.voidsetMarginRight(double value)Sets margin right.voidsetMarginTop(double value)Sets margin top.voidsetPaperOrientation(PaperOrientation value)Sets paper orientation.voidsetPaperSize(PaperSize value)Sets paper size.voidsetPrintHtmlBackgrounds(boolean value)Sets print html backgrounds.voidsetTableOfContents(TableOfContentsTypes value)Sets TableOfContents.voidsetTitle(String value)Sets title.voidsetWaitFor(WaitFor waitFor)Sets a wrapper object that holds configuration for wait-for mechanism for user to wait for certain events before rendering.voidUseChromeDefaultRendering()Lays out PDF pages in the same way as when viewed from Google Chrome's print preview.voidUseContinuousFeedRendering()Creates a single page PDF which will force its entire content's width and height to fit into one page.voidUseContinuousFeedRendering(double width)Creates a single page PDF which will force its entire content's width and height to fit into one page.voidUseContinuousFeedRendering(double width, int margin)Creates a single page PDF which will force its entire content's width and height to fit into one page.voidUseContinuousFeedRendering(int margin)Creates a single page PDF which will force its entire content's width and height to fit into one page.voidUseFitToPageRendering()Scales content to fit the specifiedsetPaperSize(PaperSize).voidUseFitToPageRendering(int minimumPixelWidth)Scales content to fit the specifiedsetPaperSize(PaperSize).voidUseResponsiveCssRendering()Uses Responsive CSS to define the rendering of the HTML based on the ViewPortWidth parameter.voidUseResponsiveCssRendering(int viewPortWidthValue)Uses Responsive CSS to define the rendering of the HTML based on the ViewPortWidth parameter.voidUseScaledRendering()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.voidUseScaledRendering(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.
 
- 
- 
- 
Method Detail- 
isCreatePdfFormsFromHtmlpublic boolean isCreatePdfFormsFromHtml() Is create pdf forms from html. Turns all Html forms elements into editable PDF forms.- Returns:
- the boolean
 
 - 
setCreatePdfFormsFromHtmlpublic void setCreatePdfFormsFromHtml(boolean value) Sets create pdf forms from html. Turns all Html forms elements into editable PDF forms.- Parameters:
- value- the value
 
 - 
getCssMediaTypepublic CssMediaType getCssMediaType() Gets css media type. Enables Media="screen" CSS Styles and StyleSheetsNote: 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. - Returns:
- the css media type
 
 - 
setCssMediaTypepublic void setCssMediaType(CssMediaType value) Sets css media type. Enables Media="screen" CSS Styles and StyleSheetsNote: 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. - Parameters:
- value- the value
 
 - 
getCustomCssUrlpublic String getCustomCssUrl() Gets custom css url. Allows a custom CSS style-sheet to be applied to Html before rendering. Maybe a local file path, or remote url.- Returns:
- the custom css url
 
 - 
setCustomCssUrlpublic void setCustomCssUrl(String value) Sets custom css url. Allows a custom CSS style-sheet to be applied to Html before rendering. Maybe a local file path, or remote url.- Parameters:
- value- the value
 
 - 
getCustomPaperHeightpublic double getCustomPaperHeight() Gets custom paper height.- Returns:
- the custom paper height
 
 - 
setCustomPaperHeightpublic void setCustomPaperHeight(double value) Sets custom paper height (mm).- Parameters:
- value- the value
 
 - 
getCustomPaperWidthpublic double getCustomPaperWidth() Gets custom paper width (mm).- Returns:
- the custom paper width
 
 - 
setCustomPaperWidthpublic void setCustomPaperWidth(double value) Sets custom paper width (mm).- Parameters:
- value- the value
 
 - 
isEnableJavaScriptpublic boolean isEnableJavaScript() Is enable JavaScript. Enables JavaScript and Json to be executed before the page is rendered. Ideal for printing from Ajax / Angular Applications.Also see waitFor- Returns:
- the boolean
 
 - 
setEnableJavaScriptpublic void setEnableJavaScript(boolean value) Sets enable JavaScript. Enables JavaScript and Json to be executed before the page is rendered. Ideal for printing from Ajax / Angular Applications.Also see waitFor- Parameters:
- value- the value
 
 - 
getFitToPaperModepublic FitToPaperModes getFitToPaperMode() use one of these method insteadUseChromeDefaultRendering()UseScaledRendering()UseResponsiveCssRendering()UseFitToPageRendering()
 - 
setFitToPaperModepublic void setFitToPaperMode(FitToPaperModes value) Deprecated.use one of these method insteadUseChromeDefaultRendering()UseScaledRendering()UseResponsiveCssRendering()UseFitToPageRendering()
 - 
isGrayScalepublic boolean isGrayScale() Is gray scale boolean. Outputs a black-and-white PDF.- Returns:
- the boolean
 
 - 
setGrayScalepublic void setGrayScale(boolean value) Sets gray scale. Outputs a black-and-white PDF.- Parameters:
- value- the value
 
 - 
getInputEncodingpublic String getInputEncoding() Gets input character encoding as a string; e.g. "utf-8" "utf-16" "ASCII"- Returns:
- the input encoding
 
 - 
setInputEncodingpublic void setInputEncoding(String value) Sets input character encoding as a string; e.g. "utf-8" "utf-16" "ASCII"- Parameters:
- value- e.g. "utf-8", "utf-16", "ASCII" or else
 
 - 
getMarginBottompublic double getMarginBottom() Gets margin bottom. Bottom Pdf "paper" margin in millimeters. Set to zero for border-less and commercial printing applications.- Returns:
- the margin bottom
 
 - 
setMarginBottompublic void setMarginBottom(double value) Sets margin bottom. Bottom Pdf "paper" margin in millimeters. Set to zero for border-less and commercial printing applications.- Parameters:
- value- the value
 
 - 
getMarginLeftpublic double getMarginLeft() Gets margin left. Left Pdf "paper" margin in millimeters. Set to zero for border-less and commercial printing applications.- Returns:
- the margin left
 
 - 
setMarginLeftpublic void setMarginLeft(double value) Sets margin left. Left Pdf "paper" margin in millimeters. Set to zero for border-less and commercial printing applications.- Parameters:
- value- the value
 
 - 
getMarginRightpublic double getMarginRight() Gets margin right. Right Pdf "paper" margin in millimeters. Set to zero for border-less and commercial printing applications.- Returns:
- the margin right
 
 - 
setMarginRightpublic void setMarginRight(double value) Sets margin right. Right Pdf "paper" margin in millimeters. Set to zero for border-less and commercial printing applications.- Parameters:
- value- the value
 
 - 
getMarginToppublic double getMarginTop() Gets margin top. Top Pdf "paper" margin in millimeters. Set to zero for border-less and commercial printing applications.- Returns:
- the margin top
 
 - 
setMarginToppublic void setMarginTop(double value) Sets margin top. Top Pdf "paper" margin in millimeters. Set to zero for border-less and commercial printing applications.- Parameters:
- value- the value
 
 - 
getPaperOrientationpublic PaperOrientation getPaperOrientation() Gets paper orientation. The PDF paper orientation. E.g. Portrait or Landscape.- Returns:
- the paper orientation
 
 - 
setPaperOrientationpublic void setPaperOrientation(PaperOrientation value) Sets paper orientation. The PDF paper orientation. E.g. Portrait or Landscape.- Parameters:
- value- the value
 
 - 
getPaperSizepublic PaperSize getPaperSize() Gets paper size. Set an output paper size for PDF pages.Use setCustomPaperSizeInMillimeters(double, double),setCustomPaperSizeInPixelsOrPoints(double, double), etc... for custom sizes.- Returns:
- the paper size
 
 - 
setPaperSizepublic void setPaperSize(PaperSize value) Sets paper size. Set an output paper size for PDF pages.Use setCustomPaperSizeInMillimeters(double, double),setCustomPaperSizeInPixelsOrPoints(double, double), etc... for custom sizes.- Parameters:
- value- the value
 
 - 
isPrintHtmlBackgroundspublic boolean isPrintHtmlBackgrounds() Is print html backgrounds boolean. Prints background-colors and images from Html.- Returns:
- the boolean
 
 - 
setPrintHtmlBackgroundspublic void setPrintHtmlBackgrounds(boolean value) Sets print html backgrounds. Prints background-colors and images from Html.- Parameters:
- value- the value
 
 - 
getTitlepublic String getTitle() Gets title. PDF Document Name and Title meta-data. Not required. Useful for mail-merge and file naming.- Returns:
- the title
 
 - 
setTitlepublic void setTitle(String value) Sets title. PDF Document Name and Title meta-data. Not required. Useful for mail-merge and file naming.- Parameters:
- value- the value
 
 - 
getJavascriptpublic String getJavascript() Get A custom javascript string to be executed after all HTML has loaded but before PDf rendering.- Returns:
- the javascript string
 
 - 
Clonepublic Object Clone() throws CloneNotSupportedException SupportsCloneable. Creates a deep copy of this class instance.- Returns:
- A deep clone of this instance. Use explicit casting to convert object back to the intended type.
- Throws:
- CloneNotSupportedException- the clone not supported exception
 
 - 
setCustomPaperSizeInCentimeterspublic void setCustomPaperSizeInCentimeters(double width, double height)Set an output paper size for PDF pages. Dimensions are in Centimeters.- Parameters:
- width- Custom paper width in cm.
- height- Custom paper height in cm.
 
 - 
setCustomPaperSizeInMillimeterspublic void setCustomPaperSizeInMillimeters(double width, double height)Set an output paper size for PDF pages. Dimensions are in millimeters.- Parameters:
- width- Custom paper width in millimeters.
- height- Custom paper height in millimeters.
 
 - 
setCustomPaperSizeInPixelsOrPointspublic void setCustomPaperSizeInPixelsOrPoints(double width, double height)Set an output paper size for PDF pages. Dimensions are in screen Pixels or printer Points.- Parameters:
- width- Custom paper width in pixels/points.
- height- Custom paper height in pixels/points..
 
 - 
setCustomPaperSizeInPixelsOrPointspublic void setCustomPaperSizeInPixelsOrPoints(double width, double height, int DPI)Set an output paper size for PDF pages. Dimensions are in screen Pixels or printer Points.- Parameters:
- 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.
 
 - 
SetCustomPaperSizeInInchespublic void SetCustomPaperSizeInInches(double width, double height)Set an output paper size for PDF pages. Dimensions are in Inches.- Parameters:
- width- Custom paper width in Inches.
- height- Custom paper height in Inches.
 
 - 
setJavascriptpublic void setJavascript(String javascript) Set A custom javascript string to be executed after all HTML has loaded but before PDf rendering.- Parameters:
- javascript- a javascript string.
 
 - 
getWaitForpublic WaitFor getWaitFor() Gets a wrapper object that holds configuration for wait-for mechanism for user to wait for certain events before rendering. By default, it will wait for nothing.
 - 
setWaitForpublic void setWaitFor(WaitFor waitFor) Sets a wrapper object that holds configuration for wait-for mechanism for user to wait for certain events before rendering. By default, it will wait for nothing.
 - 
getViewPortWidthpublic int getViewPortWidth() internal use
 - 
getViewPortHeightpublic int getViewPortHeight() internal use
 - 
getZoompublic int getZoom() internal use
 - 
UseChromeDefaultRenderingpublic void 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 SizesetPaperSize(PaperSize). To change this responsive behavior useUseResponsiveCssRendering()
 - 
UseScaledRenderingpublic 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. Responsive CSS is interpreted based on the width of thesetPaperSize(PaperSize)Specified Paper Size
 - 
UseScaledRenderingpublic 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. Responsive CSS is interpreted based on the width of thesetPaperSize(PaperSize)Specified Paper Size- Parameters:
- zoomPercentage- A percentage based scale factor on the HTML document.
 
 - 
UseResponsiveCssRenderingpublic void UseResponsiveCssRendering() Uses Responsive CSS to define the rendering of the HTML based on the ViewPortWidth parameter. Content will attempt to scale the rendered content to fill the width of thesetPaperSize(PaperSize)Specified Paper Size SetsetCssMediaType(com.ironsoftware.ironpdf.render.CssMediaType)to choose between paper and screen CSS interpretations.
 - 
UseResponsiveCssRenderingpublic void UseResponsiveCssRendering(int viewPortWidthValue) Uses Responsive CSS to define the rendering of the HTML based on the ViewPortWidth parameter. Content will attempt to scale the rendered content to fill the width of thesetPaperSize(PaperSize)Specified Paper Size SetsetCssMediaType(com.ironsoftware.ironpdf.render.CssMediaType)to choose between paper and screen CSS interpretations.- Parameters:
- viewPortWidthValue- A pixel based virtual browser viewport for responsive CSS designs.
 
 - 
UseFitToPageRenderingpublic void UseFitToPageRendering() Scales content to fit the specifiedsetPaperSize(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.
 - 
UseFitToPageRenderingpublic void UseFitToPageRendering(int minimumPixelWidth) Scales content to fit the specifiedsetPaperSize(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.- Parameters:
- minimumPixelWidth- A pixel based minimum with for the document. Can help HTML elements to display correctly and respond appropriately to CSS3 responsive layout rules.
 
 - 
UseContinuousFeedRenderingpublic void UseContinuousFeedRendering() 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.
 - 
UseContinuousFeedRenderingpublic void UseContinuousFeedRendering(int margin) 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.- Parameters:
- margin- The margin in millimeters to apply to the PDF page. Default is 5
 
 - 
UseContinuousFeedRenderingpublic void UseContinuousFeedRendering(double width) 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.- Parameters:
- width- The width in millimeters to apply to the PDF page. Default is 80
 
 - 
UseContinuousFeedRenderingpublic 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. Can be used for a consumer bill or receipt.- Parameters:
- width- The width in millimeters to apply to the PDF page. Default is 80
- margin- The margin in millimeters to apply to the PDF page. Default is 5
 
 - 
getTableOfContentspublic TableOfContentsTypes getTableOfContents() Gets TableOfContents. Generate a table of contents at the location in the HTML document where an element is found with id "ironpdf-toc".- Returns:
- the title
 
 - 
setTableOfContentspublic void setTableOfContents(TableOfContentsTypes value) Sets TableOfContents. Generate a table of contents at the location in the HTML document where an element is found with id "ironpdf-toc".- Parameters:
- value- the value
 
 
- 
 
-