Class Settings
- java.lang.Object
-
- com.ironsoftware.ironpdf.Settings
-
public final class Settings extends Object
Important global settings for configuration of IronPDF for Java
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Settings.ChromeGpuModes
Chrome GPU hardware utilization when rendering HTML to PDF
-
Constructor Summary
Constructors Constructor Description Settings()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Path
getChromeBrowserCachePath()
Disk cache path for Chrome browser instances default nullstatic int
getChromeBrowserLimit()
Get Maximum number of concurrent browsers when using the Chrome renderer default is 30static Settings.ChromeGpuModes
getChromeGpuMode()
Chrome renderer GPU compatibility mode.static IronPdfEngineConnection
getConnectionMode()
Get IronPdfEngineConnection to set up various connection modes for IronPdfEngine.static String
getIronPdfEngineHost()
Deprecated.This method is obsolete.static int
getIronPdfEnginePort()
Deprecated.This method is obsolete.static int
getIronPdfEngineTimeout()
A Timeout (in seconds) to wait for any response from IronPdfEngine default 120 secondsstatic String
getIronPdfEngineVersion()
Gets IronPDF engine version.static Path
getIronPdfEngineWorkingDirectory()
Gets path to IronPDF engine working directory.static Path
getLogPath()
Gets IronPDF engine log file path.static Path
getTempFolderPath()
Get temp folder path.static boolean
isAutoInstallDependency()
If true The necessary package dependencies for IronPDF rendering will we automatically installed to Docker and Debian / Ubuntu Linux deployments.static boolean
isDebug()
Is debug boolean.static boolean
isSingleProcess()
SingleProcess mode Forces Chrome renderer to perform everything in the current process, rather than using subprocesses default is falsestatic void
setAutoInstallDependency(boolean isAutoInstallDependency)
If true The necessary package dependencies for IronPDF rendering will we automatically installed to Docker and Debian / Ubuntu Linux deployments.static void
setChromeBrowserCachePath(Path chromeBrowserCachePath)
Disk cache path for Chrome browser instances default nullstatic void
setChromeBrowserLimit(int chromeBrowserLimit)
Set Maximum number of concurrent browsers when using the Chrome renderer default is 30static void
setChromeGpuMode(Settings.ChromeGpuModes chromeGpuMode)
Chrome renderer GPU compatibility mode.static void
setConnectionMode(IronPdfEngineConnection ironPdfEngineConnection)
Set IronPdfEngineConnection to set up various connection modes for IronPdfEngine.static void
setDebug(boolean isDebug)
Enable or disable debug mode.static void
setIronPdfEngineHost(String host)
Deprecated.This method is obsolete.static void
setIronPdfEnginePort(int port)
Deprecated.This method is obsolete.static void
setIronPdfEngineTimeout(int ironPdfEngineTimeout)
A Timeout (in seconds) to wait for any response from IronPdfEngine default 120 secondsstatic void
setIronPdfEngineWorkingDirectory(Path path)
Sets path to IronPDF engine working directory.static void
setLogPath(Path path)
Sets IronPDF engine log file path.static void
setSingleProcess(boolean isSingleProcess)
SingleProcess mode Forces Chrome renderer to perform everything in the current process, rather than using subprocesses default is falsestatic void
setTempFolderPath(Path tempFolderPath)
Set temp folder path.static void
useIronPdfEngineDocker()
Deprecated.This method is obsolete.static void
useIronPdfEngineDocker(int port)
Deprecated.
-
-
-
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)
-
isDebug
public static boolean isDebug()
Is debug boolean.***Only works with
IronPdfEngineConnection.withSubprocess()
- Returns:
- true if debug mode is enabled.
-
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
-
getLogPath
public static Path getLogPath()
Gets IronPDF engine log file path.***Only works with
IronPdfEngineConnection.withSubprocess()
- Returns:
- the log file path
-
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
-
setTempFolderPath
public static void setTempFolderPath(Path tempFolderPath)
Set temp folder path.***Only works with
IronPdfEngineConnection.withSubprocess()
- Parameters:
tempFolderPath
- the temp folder path
-
getTempFolderPath
public static Path getTempFolderPath()
Get temp folder path.***Only works with
IronPdfEngineConnection.withSubprocess()
- Returns:
- the 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.
-
setChromeBrowserCachePath
public static void setChromeBrowserCachePath(Path chromeBrowserCachePath) throws IOException
Disk cache path for Chrome browser instances default null***Only works with
IronPdfEngineConnection.withSubprocess()
- Parameters:
chromeBrowserCachePath
-- Throws:
IOException
- the io exception
-
getChromeGpuMode
public static Settings.ChromeGpuModes getChromeGpuMode()
Chrome renderer GPU compatibility mode. In special environment like Docker or Cloud Service please use ChromeGpuModes.Disabled default null***Only works with
IronPdfEngineConnection.withSubprocess()
- Returns:
- chromeBrowserCachePath.
-
setChromeGpuMode
public static void setChromeGpuMode(Settings.ChromeGpuModes chromeGpuMode) throws IOException
Chrome renderer GPU compatibility mode. In special environment like Docker or Cloud Service please use ChromeGpuModes.Disabled default Disabled***Only works with
IronPdfEngineConnection.withSubprocess()
- Parameters:
chromeGpuMode
-- Throws:
IOException
- the io exception
-
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
-
setIronPdfEngineHost
@Deprecated public static void setIronPdfEngineHost(String host)
Deprecated.This method is obsolete. UsesetConnectionMode(IronPdfEngineConnection)
instead.
-
getIronPdfEngineHost
@Deprecated public static String getIronPdfEngineHost()
Deprecated.This method is obsolete. UsegetConnectionMode()
instead.
-
setIronPdfEnginePort
@Deprecated public static void setIronPdfEnginePort(int port)
Deprecated.This method is obsolete. UsesetConnectionMode(IronPdfEngineConnection)
instead.
-
getIronPdfEnginePort
@Deprecated public static int getIronPdfEnginePort()
Deprecated.This method is obsolete. UsegetConnectionMode()
instead.
-
useIronPdfEngineDocker
@Deprecated public static void useIronPdfEngineDocker()
Deprecated.This method is obsolete. UsesetConnectionMode(IronPdfEngineConnection)
instead.
-
useIronPdfEngineDocker
@Deprecated public static void useIronPdfEngineDocker(int port)
Deprecated.
-
-