Class Settings


  • public final class Settings
    extends Object
    Important global settings for configuration of IronPDF for Java
    • Constructor Detail

      • Settings

        public Settings()
    • Method Detail

      • getIronPdfEngineVersion

        public static String getIronPdfEngineVersion()
        Gets IronPDF engine version.
        Returns:
        The current IronPdfEngine version
      • getConnectionMode

        public static IronPdfEngineConnection getConnectionMode()
        Get IronPdfEngineConnection to set up various connection modes for IronPdfEngine.

        The supported connection modes are:

        - SUBPROCESS: (Default) Launch a local IronPdfEngine as a subprocess.

        - HOST_PORT: Connect to IronPdfEngine using a host and port.

        - TARGET: Connect to IronPdfEngine using a target string (e.g., DNS-based resolution).

        - OFFICIAL_CLOUD: Connect to an official cloud-based IronPdfEngine. (require subscription License)

        - CUSTOM: Connect to IronPdfEngine using a custom gRPC connection.

        Example usage:

         IronPdfEngineConnection settings = IronPdfEngineConnection.configure()
              .withHostPort("localhost", 33350); 
         

        Get IronPDF engine docker @see official-ironpdfengine-docker

      • setConnectionMode

        public static void setConnectionMode​(IronPdfEngineConnection ironPdfEngineConnection)
        Set IronPdfEngineConnection to set up various connection modes for IronPdfEngine.

        The supported connection modes are:

        - SUBPROCESS: Launch a local IronPdfEngine as a subprocess.

        - HOST_PORT: Connect to IronPdfEngine using a host and port.

        - TARGET: Connect to IronPdfEngine using a target string (e.g., DNS-based resolution).

        - OFFICIAL_CLOUD: (Default for IronPDF for Java Cloud) Connect to an official cloud-based IronPdfEngine. (require subscription License)

        - CUSTOM: Connect to IronPdfEngine using a custom gRPC connection.

        Example usage:

         IronPdfEngineConnection settings = IronPdfEngineConnection.configure()
              .withHostPort("localhost", 33350); 
         

        Get IronPDF engine docker @see official-ironpdfengine-docker

      • getIronPdfEngineTimeout

        public static int getIronPdfEngineTimeout()
        A Timeout (in seconds) to wait for any response from IronPdfEngine default 120 seconds
        Returns:
        IronPdfEngineTimeout (seconds)
      • setIronPdfEngineTimeout

        public static void setIronPdfEngineTimeout​(int ironPdfEngineTimeout)
        A Timeout (in seconds) to wait for any response from IronPdfEngine default 120 seconds
        Parameters:
        ironPdfEngineTimeout - (seconds)
      • setDebug

        public static void setDebug​(boolean isDebug)
        Enable or disable debug mode.

        ***Needed to set before calling any IronPdf function.***

        ***Only works with IronPdfEngineConnection.withSubprocess()

        Parameters:
        isDebug - is debug enabled
      • getIronPdfEngineWorkingDirectory

        public static Path getIronPdfEngineWorkingDirectory()
        Gets path to IronPDF engine working directory. default is current directory. If IronPdfEngine binary does not exist, We will download automatically to this folder.

        ***Only works with IronPdfEngineConnection.withSubprocess()

        Returns:
        custom IronPdfEngine folder.
      • setIronPdfEngineWorkingDirectory

        public static void setIronPdfEngineWorkingDirectory​(Path path)
                                                     throws IOException
        Sets path to IronPDF engine working directory. default is current directory. If IronPdfEngine binary does not exist, We will download automatically to this folder.

        ***Needed to set before calling any IronPdf function.***

        ***Only works with IronPdfEngineConnection.withSubprocess()

        Parameters:
        path - the path
        Throws:
        IOException - the io exception
      • setLogPath

        public static void setLogPath​(Path path)
        Sets IronPDF engine log file path.

        ***Recommended to set before calling any IronPdf function.***

        ***Only works with IronPdfEngineConnection.withSubprocess()

        Parameters:
        path - the log file path
      • isSingleProcess

        public static boolean isSingleProcess()
        SingleProcess mode Forces Chrome renderer to perform everything in the current process, rather than using subprocesses default is false

        ***Only works with IronPdfEngineConnection.withSubprocess()

        Returns:
        true if SingleProcess mode is enabled.
      • setSingleProcess

        public static void setSingleProcess​(boolean isSingleProcess)
        SingleProcess mode Forces Chrome renderer to perform everything in the current process, rather than using subprocesses default is false

        ***Only works with IronPdfEngineConnection.withSubprocess()

        Parameters:
        isSingleProcess - is SingleProcess enabled
      • setChromeBrowserLimit

        public static void setChromeBrowserLimit​(int chromeBrowserLimit)
        Set Maximum number of concurrent browsers when using the Chrome renderer default is 30

        ***Only works with IronPdfEngineConnection.withSubprocess()

        Parameters:
        chromeBrowserLimit -
      • getChromeBrowserLimit

        public static int getChromeBrowserLimit()
        Get Maximum number of concurrent browsers when using the Chrome renderer default is 30

        ***Only works with IronPdfEngineConnection.withSubprocess()

        Returns:
        chromeBrowserLimit
      • getChromeBrowserCachePath

        public static Path getChromeBrowserCachePath()
        Disk cache path for Chrome browser instances default null

        ***Only works with IronPdfEngineConnection.withSubprocess()

        Returns:
        chromeBrowserCachePath.
      • isAutoInstallDependency

        public static boolean isAutoInstallDependency()
        If true The necessary package dependencies for IronPDF rendering will we automatically installed to Docker and Debian / Ubuntu Linux deployments. This will take a few minutes the next time you run IronPDF. Set this to false if manual Docker / Linux setup is more convenient: more info default is true

        ***Only works with IronPdfEngineConnection.withSubprocess()

        Returns:
        true if AutoInstallDependency mode is enabled.
      • setAutoInstallDependency

        public static void setAutoInstallDependency​(boolean isAutoInstallDependency)
        If true The necessary package dependencies for IronPDF rendering will we automatically installed to Docker and Debian / Ubuntu Linux deployments. This will take a few minutes the next time you run IronPDF. Set this to false if manual Docker / Linux setup is more convenient: more info default is true

        ***Only works with IronPdfEngineConnection.withSubprocess()

        Parameters:
        isAutoInstallDependency - is SingleProcess enabled
      • useIronPdfEngineDocker

        @Deprecated
        public static void useIronPdfEngineDocker​(int port)
        Deprecated.