public class IronPdfEngineConnection extends Object
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: (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
| Modifier and Type | Class and Description |
|---|---|
static class |
IronPdfEngineConnection.ConnectionMode |
| Constructor and Description |
|---|
IronPdfEngineConnection() |
| Modifier and Type | Method and Description |
|---|---|
static IronPdfEngineConnection |
configure()
Static factory method to initiate the configuration of IronPdfEngineConnection.
|
io.grpc.ManagedChannel |
getCustomChannel()
Retrieves custom channel.
|
String |
getHost()
Retrieves the host name of the gRPC server.
|
IronPdfEngineConnection.ConnectionMode |
getMode()
Retrieves the current connection mode (HOST_PORT, TARGET, SUBPROCESS, or CUSTOM).
|
int |
getPort()
Retrieves the port number of the IronPdfEngine.
|
String |
getTarget()
Retrieves the target string used for service discovery (if applicable).
|
String |
toString()
Provides a string representation of the current IronPdfEngine settings.
|
IronPdfEngineConnection |
withCustomGrpcConnection(io.grpc.ManagedChannel customChannel) |
IronPdfEngineConnection |
withHostPort(String host,
int port)
Recommended for hosting IronPdfEngine Docker in local network.
|
IronPdfEngineConnection |
withOfficialCloud()
Configures IronPDF Java to use an official cloud-based IronPdfEngine.
|
IronPdfEngineConnection |
withSubprocess()
Default use-case.
|
IronPdfEngineConnection |
withSubprocess(int port)
Recommended if port 33350 is not available.
|
IronPdfEngineConnection |
withTarget(String target)
Recommended for hosting IronPdfEngine Docker in Cloud or remote server.
|
public static IronPdfEngineConnection configure()
IronPdfEngineConnection settings = IronPdfEngineConnection.configure()
.withHostPort("localhost", 8080);
public IronPdfEngineConnection withHostPort(String host, int port)
Recommended for hosting IronPdfEngine Docker in local network.
Set IronPdfEngine connection mode using host and port.
This mode allows connecting to an already running IronPdfEngine.
Use IronPDF engine docker. All PDF operation will happen on the connected IronPDF engine docker.
This setting required IronPdfEngine is already up and running in docker. (on the given port)
Get IronPDF engine docker @see official-ironpdfengine-docker}
host - The hostname or IP address of the IronPdfEngine.port - The port number where the IronPdfEngine is running.IllegalArgumentException - if the host is null or empty, or if the port is out of range.public IronPdfEngineConnection withTarget(String target)
Recommended for hosting IronPdfEngine Docker in Cloud or remote server.
Set IronPdfEngine connection mode using a target string.
This mode is typically used for service discovery mechanisms (e.g., DNS, load balancing).
target - The target string (e.g., "dns:///my-service:8080").public IronPdfEngineConnection withSubprocess()
Default use-case. IronPDF Java will spawn IronPdfEngine as a local subprocess.
Launch a IronPdfEngine as a subprocess.
The subprocess will be launched with a predefined host (localhost) and port (33350).
To use another port withSubprocess(int)
public IronPdfEngineConnection withSubprocess(int port)
Recommended if port 33350 is not available.
Launch a IronPdfEngine as a subprocess with a custom port.
The subprocess will be launched with a predefined host (localhost) and custom port.
port - The port number where the IronPdfEngine subprocess will be used.public IronPdfEngineConnection withOfficialCloud()
Configures IronPDF Java to use an official cloud-based IronPdfEngine.
Only works for Subscription license. For more information please contact sales@ironsoftware.com
public IronPdfEngineConnection withCustomGrpcConnection(io.grpc.ManagedChannel customChannel)
public String getHost()
public int getPort()
public String getTarget()
public IronPdfEngineConnection.ConnectionMode getMode()
public io.grpc.ManagedChannel getCustomChannel()
public String toString()
Copyright © 2022–2025 Iron Software. All rights reserved.