ironsoftwareofficial/ironpdfengine

By ironsoftwareofficial

Updated about 11 hours ago

Isolated IronPDF container for easy HTML-to-PDF generation on any platform!

Image
Developer Tools

50K+

Hosting you own IronPDF Docker Container

Currently supports Java and .NET

Only works with IronPDF v.2023.2.x and above

IronPdfEngine is a gRPC service which can handle the creating, writing, editing, and reading of PDFs.

IronPDF Docker is ready to run docker services with compatible versions of IronPDF (v2023.2.x and above). This will help developers eradicate deployment issues that they may be experiencing with IronPDF.

Why

IronPDF requires both Chrome and Pdfium binaries in order to operate which are huge in file size (hundreds of MBs). It also requires several dependencies to be installed on the machine.

By using this method, your client will only take up a fraction of the size (in MB).

Avoid Deployment Issues

It can be difficult to configure the environment/container to properly include all dependencies. Using the IronPDF Docker container means that IronPDF comes pre-installed and guaranteed to work, avoiding all deployment and dependency headaches.

Avoid Critical Segfault

Using IronPDF Docker container totally mitigates a critical issue that some users experience when running IronPdf in a Linux container.

Versions

The IronPDF Docker tag is based on the version of IronPdfEngine itself. It is not the same version as the IronPDF product.

Each IronPDF version will have its own associated IronPdfEngine version. The version number must match the IronPDF Docker version.

For example: For IronPDF for Java version 2023.2.1 requires IronPdfEngine version 2023.2.1. You cannot use mistmatched IronPdfEngine and IronPDF versions.

How to use IronPDF Docker for Java

Step 1 - Install IronPDF

Add IronPdf to your project.

    <dependency>
        <groupId>com.ironsoftware</groupId>
        <artifactId>ironpdf</artifactId>
        <version>20xx.xx.xxxx</version>
    </dependency>

| More info: https://ironpdf.com/java/docs/

Step 2 - Determine Required Container Version

By default, the IronPDF for Docker version will match the current version of IronPDF on NuGet.

You may additionally confirm by checking the version manually:

string ironPdfEngineVersion = Settings.getIronPdfEngineVersion();
Step 3 - Setup IronPDF for Docker Container

Pull the version from the previous step.

For example for IronPDF for Docker:

docker pull ironsoftwareofficial/ironpdfengine
docker run -d -p 33350:33350 ironsoftwareofficial/ironpdfengine

Now IronPDF for Docker is up and running!

Port 33350 is the default internal port of IronPdfEngine

Step 4 - Configure your IronPDF Client
  • Add this line:
Settings.useIronPdfEngineDocker(33350);
  • Package com.ironsoftware:ironpdf-engine-xxxx-xx is no longer used, so you should remove it from your project.
Step 5 - Enjoy

Run your IronPDF code, your app now talks to the IronPdfEngine in Docker!

How to use IronPDF Docker for .NET

Step 1 - Install IronPDF

Add the IronPdf.Slim Nuget package to your project.

https://www.nuget.org/packages/IronPdf.Slim/

| More info: https://ironpdf.com/docs/

Note: IronPdf, IronPdf.Linux and IronPdf.MacOs Packages all contain IronPdf.Slim.

To reduce your application size, we recommend installing just IronPdf.Slim. Package IronPdf.Native.Chrome.xxx is no longer used, so you can remove it from your project.

Step 2 - Determine Required Container Version

By default, the IronPDF for Docker version will match the current version of IronPDF on NuGet.

You may additionally confirm by checking the version manually:

string ironPdfEngineVersion = Installation.IronPdfEngineVersion();
Step 3 - Setup IronPDF for Docker Container

Step 3.i - Without Docker Compose

Pull the version from the previous step.

For example for `IronPDF for Docker:

docker pull ironsoftwareofficial/ironpdfengine
docker run -d -p 33350:33350 ironsoftwareofficial/ironpdfengine

Port 33350 is the default internal port of IronPdfEngine

Now IronPDF for Docker is up and running!

Step 3.ii - With Docker Compose

Config docker network

docker network create -d bridge --attachable --subnet=172.19.0.0/16 --gateway=172.19.0.1 ironpdf-network

docker run -d -e IRONPDF_ENGINE_LICENSE_KEY=MY_LICENSE_KEY --network=ironpdf-network --ip=172.19.0.2 --name=ironpdfengine --hostname=ironpdfengine -p 33350:33350 ironsoftwareofficial/ironpdfengine:2023.2.1

Set up your Docker Compose file using the following template:

version: "3.3"

services:
  ironpdfengine:
    container_name: ironpdfengine
    image: ironsoftwareofficial/ironpdfengine:latest
    networks:
      ironpdf-network:
        ipv4_address: 172.19.0.2
  myconsoleapp:
    container_name: myconsoleapp
    build:
      # enter YOUR project directory path here
      context: ./MyConsoleApp/
      # enter YOUR dockerfile name here, relative to project directory
      dockerfile: Dockerfile
    networks:
      ironpdf-network:
        ipv4_address: 172.19.0.3
    depends_on:
      ironpdfengine:
        condition: service_started

networks:
  ironpdf-network:
    driver: bridge
    ipam:
      config:
        - subnet: 172.19.0.0/16
          gateway: 172.19.0.1

And then run your docker compose command like the following:

docker compose up --detach --force-recreate --remove-orphans --timestamps
Step 4 - Configure you IronPDF Client

Add this line:

Installation.UseIronPdfEngineDocker();
Step 5 - Enjoy

Run your IronPDF code, your app now talks to the IronPdfEngine in Docker!

Client Test Code

Installation.UseIronPdfEngineDocker();
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Hello IronPDF Docker!<h1>");
pdf.SaveAs("ironpdf.pdf");

More Resources

Visit https://ironpdf.com/how-to/ironpdfengine-docker/ for more information on how to use IronPDF for Docker.

Docker Pull Command

docker pull ironsoftwareofficial/ironpdfengine