Class ChromePdfRenderOptions

  • All Implemented Interfaces:
    Cloneable

    public class ChromePdfRenderOptions
    extends Object
    implements Cloneable
    Html To PDF output options for Render_Api. Specify options such as Paper-Size, DPI, Headers and Footers and other Chromium specific browser setup options.
    • Constructor Detail

      • ChromePdfRenderOptions

        public ChromePdfRenderOptions()
    • Method Detail

      • isCreatePdfFormsFromHtml

        public boolean isCreatePdfFormsFromHtml()
        Is create pdf forms from html. Turns all Html forms elements into editable PDF forms.
        Returns:
        the boolean
      • setCreatePdfFormsFromHtml

        public void setCreatePdfFormsFromHtml​(boolean value)
        Sets create pdf forms from html. Turns all Html forms elements into editable PDF forms.
        Parameters:
        value - the value
      • getCssMediaType

        public CssMediaType getCssMediaType()
        Gets css media type. Enables Media="screen" CSS Styles and StyleSheets

        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.

        Returns:
        the css media type
      • setCssMediaType

        public void setCssMediaType​(CssMediaType value)
        Sets css media type. Enables Media="screen" CSS Styles and StyleSheets

        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.

        Parameters:
        value - the value
      • getCustomCssUrl

        public 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
      • setCustomCssUrl

        public 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
      • getCustomPaperHeight

        public double getCustomPaperHeight()
        Gets custom paper height.
        Returns:
        the custom paper height
      • setCustomPaperHeight

        public void setCustomPaperHeight​(double value)
        Sets custom paper height (mm).
        Parameters:
        value - the value
      • getCustomPaperWidth

        public double getCustomPaperWidth()
        Gets custom paper width (mm).
        Returns:
        the custom paper width
      • setCustomPaperWidth

        public void setCustomPaperWidth​(double value)
        Sets custom paper width (mm).
        Parameters:
        value - the value
      • isEnableJavaScript

        public 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 renderDelay

        Returns:
        the boolean
      • setEnableJavaScript

        public 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 renderDelay

        Parameters:
        value - the value
      • isGrayScale

        public boolean isGrayScale()
        Is gray scale boolean. Outputs a black-and-white PDF.
        Returns:
        the boolean
      • setGrayScale

        public void setGrayScale​(boolean value)
        Sets gray scale. Outputs a black-and-white PDF.
        Parameters:
        value - the value
      • getInputEncoding

        public String getInputEncoding()
        Gets input character encoding as a string;
        Returns:
        the input encoding
      • getMarginBottom

        public 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
      • setMarginBottom

        public 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
      • getMarginLeft

        public 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
      • setMarginLeft

        public 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
      • getMarginRight

        public 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
      • setMarginRight

        public 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
      • getMarginTop

        public 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
      • setMarginTop

        public 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
      • getPaperOrientation

        public PaperOrientation getPaperOrientation()
        Gets paper orientation. The PDF paper orientation. E.g. Portrait or Landscape.
        Returns:
        the paper orientation
      • setPaperOrientation

        public void setPaperOrientation​(PaperOrientation value)
        Sets paper orientation. The PDF paper orientation. E.g. Portrait or Landscape.
        Parameters:
        value - the value
      • isPrintHtmlBackgrounds

        public boolean isPrintHtmlBackgrounds()
        Is print html backgrounds boolean. Prints background-colors and images from Html.
        Returns:
        the boolean
      • setPrintHtmlBackgrounds

        public void setPrintHtmlBackgrounds​(boolean value)
        Sets print html backgrounds. Prints background-colors and images from Html.
        Parameters:
        value - the value
      • getRenderDelay

        public int getRenderDelay()
        Gets render delay. Milliseconds to wait after Html is rendered before printing. This can use useful when considering the rendering of JavaScript, Ajax or animations.
        Returns:
        the render delay
      • setRenderDelay

        public void setRenderDelay​(int value)
        Sets render delay. Milliseconds to wait after Html is rendered before printing. This can use useful when considering the rendering of JavaScript, Ajax or animations.
        Parameters:
        value - the value
      • getTimeout

        public int getTimeout()
        Gets timeout. Render timeout in seconds.
        Returns:
        the timeout
      • setTimeout

        public void setTimeout​(int value)
        Sets timeout. Render timeout in seconds.
        Parameters:
        value - the value
      • getTitle

        public String getTitle()
        Gets title. PDF Document Name and Title meta-data. Not required. Useful for mail-merge and file naming.
        Returns:
        the title
      • setTitle

        public 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
      • getViewPortHeight

        public int getViewPortHeight()
        Gets view port height. Defines a virtual screen height used to render HTML to PDF in IronPdf. Measured in pixels.

        Viewport size is important in modern responsive HTML5 + CSS3 websites (e.g. Bootstrap framework websites) because the rendering and order of elements on the screen is dependent on viewport size.

        The default viewport is 1280px wide by 1024px high to ensure the desktop version of a website is rendered unless otherwise specified. Smaller sizes (particularly width) will render responsive versions of many websites.

        Returns:
        the view port height
      • setViewPortHeight

        public void setViewPortHeight​(int value)
        Sets view port height. Defines a virtual screen height used to render HTML to PDF in IronPdf. Measured in pixels.

        Viewport size is important in modern responsive HTML5 + CSS3 websites (e.g. Bootstrap framework websites) because the rendering and order of elements on the screen is dependent on viewport size.

        The default viewport is 1280px wide by 1024px high to ensure the desktop version of a website is rendered unless otherwise specified. Smaller sizes (particularly width) will render responsive versions of many websites.

        Parameters:
        value - the value
      • getViewPortWidth

        public int getViewPortWidth()
        Gets view port width. Defines a virtual screen width used to render HTML to PDF in IronPdf. Measured in pixels.

        Viewport size is important in modern responsive HTML5 + CSS3 websites (e.g. Bootstrap framework websites) because the rendering and order of elements on the screen is dependent on viewport size.

        The default viewport is 1280px wide by 1024px high to ensure the desktop version of a website is rendered unless otherwise specified. Smaller sizes (particularly width) will render responsive versions of many website

        Returns:
        the view port width
      • setViewPortWidth

        public void setViewPortWidth​(int value)
        Sets view port width. Defines a virtual screen width used to render HTML to PDF in IronPdf. Measured in pixels.

        Viewport size is important in modern responsive HTML5 + CSS3 websites (e.g. Bootstrap framework websites) because the rendering and order of elements on the screen is dependent on viewport size.

        The default viewport is 1280px wide by 1024px high to ensure the desktop version of a website is rendered unless otherwise specified. Smaller sizes (particularly width) will render responsive versions of many website

        Parameters:
        value - the value
      • getZoom

        public int getZoom()
        Gets zoom. The zoom level in %. Enlarges the rendering size of Html documents.
        Returns:
        the zoom
      • setZoom

        public void setZoom​(int value)
        Sets zoom. The zoom level in %. Enlarges the rendering size of Html documents.
        Parameters:
        value - the value
      • getTextHeader

        public TextHeaderFooter getTextHeader()
        Gets text header. The header content for every PDF page as text. Supports 'mail-merge' and automatically turns urls into hyperlinks.
        Returns:
        the text header
      • setTextHeader

        public void setTextHeader​(TextHeaderFooter value)
        Sets text header. The header content for every PDF page as text. Supports 'mail-merge' and automatically turns urls into hyperlinks.
        Parameters:
        value - the value
      • getTextFooter

        public TextHeaderFooter getTextFooter()
        Gets text footer. Sets the footer content for every PDF page as text. Supports 'mail-merge' and automatically turns urls into hyperlinks.
        Returns:
        the text footer
      • setTextFooter

        public void setTextFooter​(TextHeaderFooter value)
        Sets text footer. Sets the footer content for every PDF page as text. Supports 'mail-merge' and automatically turns urls into hyperlinks.
        Parameters:
        value - the value
      • getHtmlHeader

        public HtmlHeaderFooter getHtmlHeader()
        Gets html header. The header content for every PDF page as Html. Supports 'mail-merge'.
        Returns:
        the html header
      • setHtmlHeader

        public void setHtmlHeader​(HtmlHeaderFooter value)
        Sets html header. The header content for every PDF page as Html. Supports 'mail-merge'.
        Parameters:
        value - the value
      • getHtmlFooter

        public HtmlHeaderFooter getHtmlFooter()
        Gets html footer. The footer content for every PDF page as Html. Supports 'mail-merge'.
        Returns:
        the html footer
      • setHtmlFooter

        public void setHtmlFooter​(HtmlHeaderFooter value)
        Sets html footer. The footer content for every PDF page as Html. Supports 'mail-merge'.
        Parameters:
        value - the value
      • setCustomPaperSizeInCentimeters

        public 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.
      • setCustomPaperSizeInMillimeters

        public 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.
      • setCustomPaperSizeInPixelsOrPoints

        public 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..
      • setCustomPaperSizeInPixelsOrPoints

        public 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.
      • SetCustomPaperSizeInInches

        public 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.