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.
How to Use IronPdfEngine in Node.js
- Install the Node.js library to utilize IronPdfEngine.
- Include the library by installing it using npm.
- Get the Chrome binary via the same installation.
- Check the version needed by accessing the `ironPdfEngineVersion` property.
- Use the IronPdfEngine to render HTML to PDF with an identical to Chrome renderer.
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/ironpdfnpm install @ironsoftware/ironpdfPros:
- Your application package will be small.
- Can deploy on many platforms.
Cons:
- Internet access is needed on the first few runs.
- Slow startup time.
Option 2 (recommended): Install IronPdfEngine as a dependency
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-x64npm install @ironsoftware/ironpdf-engine-windows-x64SHELLWindows x86:
npm install @ironsoftware/ironpdf-engine-windows-x86npm install @ironsoftware/ironpdf-engine-windows-x86SHELLLinux x64:
npm install @ironsoftware/ironpdf-engine-linux-x64npm install @ironsoftware/ironpdf-engine-linux-x64SHELLmacOS x64:
npm install @ironsoftware/ironpdf-engine-macos-x64npm install @ironsoftware/ironpdf-engine-macos-x64SHELL- macOS arm:
npm install @ironsoftware/ironpdf-engine-macos-arm64npm install @ironsoftware/ironpdf-engine-macos-arm64SHELL
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;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"
});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."
Preguntas Frecuentes
¿Para qué se utiliza IronPdfEngine en Node.js?
IronPdfEngine es un servidor gRPC utilizado en Node.js para gestionar tareas PDF como creación, edición y renderización, ofreciendo una experiencia fluida en el manejo de PDF.
¿Cómo puedo instalar IronPDF for Node.js?
Puede instalar IronPDF for Node.js usando npm con el comando npm install @Iron Software/ironpdf.
¿Cuáles son las diferencias entre configuraciones locales y remotas para IronPdfEngine?
Una configuración local implica descargar IronPdfEngine en tiempo de ejecución o instalarlo como dependencia, ofreciendo tiempos de inicio más rápidos. Una configuración remota se conecta a un IronPdfEngine alojado de forma remota, eliminando la necesidad de instalaciones locales.
¿Cómo aseguro la compatibilidad entre las versiones de IronPdf e IronPdfEngine?
Cada versión de IronPDF for Node.js requiere una versión específica de IronPdfEngine. Use la propiedad ironPdfEngineVersion para verificar la versión requerida y garantizar que ambas versiones coincidan.
¿Cuáles son los beneficios de instalar IronPdfEngine como una dependencia?
Instalar IronPdfEngine como una dependencia resulta en tiempos de inicio más rápidos y elimina la necesidad de acceso a internet después de la instalación, aunque aumenta el tamaño del paquete de la aplicación.
¿Cómo me conecto a un IronPdfEngine remoto?
Para conectarse a un IronPdfEngine remoto, use IronPdfGlobalConfig.setConfig para especificar la dirección del servidor, asegurándose de que sea accesible y no esté bloqueada por un firewall.
¿Se requiere acceso a internet para descargas en tiempo de ejecución de IronPdfEngine?
Sí, se requiere acceso a internet en las primeras ejecuciones al descargar IronPdfEngine en tiempo de ejecución, lo que también resulta en tiempos de inicio más lentos.
¿Necesito instalar IronPdfEngine para su uso remoto?
No, cuando utiliza un IronPdfEngine remoto, no necesita instalarlo localmente como una dependencia.
¿Puede IronPdfEngine ser utilizado en diferentes plataformas?
Sí, IronPdfEngine puede ser desplegado en múltiples plataformas. Los comandos npm específicos para la plataforma están disponibles para instalaciones en Windows, Linux y macOS.
¿IronPDF es compatible con .NET 10 y qué entornos admite?
Sí, IronPDF es totalmente compatible con .NET 10 (junto con .NET 9, 8, 7, etc.). Es compatible con C#, VB.NET y F#, y funciona en plataformas como Windows, Linux y macOS, incluyendo Docker y entornos en la nube, lo que lo hace ideal para proyectos web, de escritorio, de consola o en la nube de .NET 10.





