How to Use IronPdfEngine

IronPdfEngine is a gRPC server crafted to oversee a range of IronPDF tasks, encompassing the creation, editing, and reading of PDF documents.

Get started with IronPDF


IronPdf Node.js and IronPdfEngine

IronPdf for Node.js requires IronPdfEngine to run. The Node.js code is just an API mask over the IronPdfEngine gRPC. So when you call any method in IronPdf for Node.js, the magic happens inside IronPdfEngine!

By default, IronPdf for Node.js will spawn IronPdfEngine as a subprocess and communicate with it until your application shuts down.

Note: Each version of IronPdf for Node.js requires a specific version of IronPdfEngine. Cross-versions are not supported.

IronPdf for Node.js with Local IronPdfEngine

Option 1: Download IronPdfEngine at runtime

By default, after you install IronPdf in your JavaScript project, on the first run, IronPdf will detect your platform (e.g., Windows x64) and download the correct IronPdfEngine binaries from the internet.

npm install @ironsoftware/ironpdf
npm install @ironsoftware/ironpdf
SHELL

Pros:

  • Your application package will be small.
  • Can deploy on many platforms.

Cons:

  • Internet access is needed on the first few runs.
  • Slow startup time.

IronPdf for Node.js allows you to add IronPdfEngine as a dependency. These IronPdfEngine dependencies bundle IronPdfEngine to a .zip file and will extract and use it automatically.

You may choose to install one or multiple of these IronPdfEngine dependencies.

Note: ironpdf and ironpdf-engine-xxx-xxx dependency versions must be the same. The ironpdf-engine-xxx-xxx dependency version does not refer to the version of IronPdfEngine inside.

Platform-Specific Installation:

  • Windows x64:

    npm install @ironsoftware/ironpdf-engine-windows-x64
    npm install @ironsoftware/ironpdf-engine-windows-x64
    SHELL
  • Windows x86:

    npm install @ironsoftware/ironpdf-engine-windows-x86
    npm install @ironsoftware/ironpdf-engine-windows-x86
    SHELL
  • Linux x64:

    npm install @ironsoftware/ironpdf-engine-linux-x64
    npm install @ironsoftware/ironpdf-engine-linux-x64
    SHELL
  • macOS x64:

    npm install @ironsoftware/ironpdf-engine-macos-x64
    npm install @ironsoftware/ironpdf-engine-macos-x64
    SHELL
  • macOS arm:
    npm install @ironsoftware/ironpdf-engine-macos-arm64
    npm install @ironsoftware/ironpdf-engine-macos-arm64
    SHELL

Pros:

  • Faster startup time.
  • Internet access is not needed after the dependency is installed.

Cons:

  • Your application package will be large.
  • Need to specify the target platforms.

IronPdf for Node.js with Remote IronPdfEngine

To use a remote IronPdfEngine, a specific version of IronPdfEngine is needed. For example, if IronPdf for Node.js version 2024.2.2 requires IronPdfEngine version 2024.2.2, do not use IronPdfEngine version 2024.2.1. Access the ironPdfEngineVersion property to check the version needed.

const ironPdfEngineVersion = IronPdfGlobalConfig.ironPdfEngineVersion;
const ironPdfEngineVersion = IronPdfGlobalConfig.ironPdfEngineVersion;
JAVASCRIPT

How to connect

Assume that IronPdfEngine runs remotely at 123.456.7.8:33350.

Refer to "How to Pull and Run IronPdfEngine".

To connect, you simply need to specify where IronPdfEngine is located (ensure the address is accessible, not blocked by a firewall). Add this code at the initial stage of your application, or just before calling any IronPdf method.

IronPdfGlobalConfig.setConfig({
    ironPdfEngineDockerAddress: "123.456.7.8:33350"
});
IronPdfGlobalConfig.setConfig({
    ironPdfEngineDockerAddress: "123.456.7.8:33350"
});
JAVASCRIPT

Simple as that! After this, your application will be connected to a Remote IronPdfEngine!

For remote IronPdfEngine, installing IronPdfEngine as a dependency is not needed. You can skip the section titled "Option 2 (recommended) install IronPdfEngine as a dependency."

Frequently Asked Questions

What is the purpose of the gRPC server mentioned?

IronPdfEngine is a gRPC server designed to manage various tasks related to PDF documents, such as creation, editing, and reading using IronPDF.

How do I install the Node.js library for PDF management?

You can install IronPdf for Node.js using npm with the command `npm install @ironsoftware/ironpdf`.

What are the pros and cons of downloading the server components at runtime?

Pros: Your application package will be small and can deploy on many platforms. Cons: Internet access is needed on the first few runs and it has a slow startup time with IronPDF.

How can I install server components as a dependency?

You can install IronPdfEngine as a dependency by using npm commands specific to your platform, such as `npm install @ironsoftware/ironpdf-engine-windows-x64` for Windows x64.

Why should the versions of the library and server components match?

Each version of IronPdf for Node.js requires a specific version of IronPdfEngine, and cross-versions are not supported to ensure compatibility.

What is the advantage of installing server components as a dependency?

The main advantage is a faster startup time, and there is no need for internet access after the dependency is installed with IronPDF.

How do I connect to a remote server for PDF tasks?

To connect to a remote IronPdfEngine, specify the server address using `IronPdfGlobalConfig.setConfig`, ensuring the address is accessible and not blocked by a firewall.

Do I need to install server components as a dependency for remote usage?

No, for remote IronPdfEngine usage, installing it as a dependency is not needed.

What is the purpose of the version-checking property?

The `ironPdfEngineVersion` property helps you check the specific version of IronPdfEngine required for your version of IronPdf for Node.js.

Chaknith Bin
Software Engineer
Chaknith works on IronXL and IronBarcode. He has deep expertise in C# and .NET, helping improve the software and support customers. His insights from user interactions contribute to better products, documentation, and overall experience.
Talk to an Expert Five Star Trust Score Rating

Ready to Get Started?