IronPDF Quickstart Guide

This article was translated from English: Does it need improvement?
Translated
View the article in English

Install IronPDF and create your first PDF in just five minutes. With its simple API, you can convert HTML, DOCX, images, and more into pixel-perfect PDFs.

1. Prerequisites


2. Install IronPDF

Standard IronPDF installation runs locally. If you want to deploy on Docker/microservices, check out Remote Engine Mode Guide.

Nuget IconGet started making PDFs with NuGet now:

  1. Install IronPDF with NuGet Package Manager

    PM > Install-Package IronPdf

  2. Copy and run this code snippet.

    IronPdf.ChromePdfRenderer
           .StaticRenderHtmlAsPdf("<p>Hello World</p>")
           .SaveAs("pixelperfect.pdf");
  3. Deploy to test on your live environment

    Start using IronPDF in your project today with a free trial
    arrow pointer
NuGet Package Manager
DLL Download

Go to the IronPDF NuGet library:

  1. In Solution Explorer, right-click on References
  2. Select 'Manage NuGet Packages' > 'Browse' > Search IronPdf
Install-Package IronPdf
  • Download IronPDF DLL package
  • Unzip the ZIP file for your OS to a location within your Solution directory
  • In Visual Studio Solution Explorer, right-click on 'Dependencies'
  • 'Add Project Reference' > Select 'Browse' to include all the DLLs extracted from the zip.

Platform-specific Guides


3. Apply License Key

When you purchase IronPDF licenses or choose to start with a 30-day trial, a license key will be sent to your email. Copy the key and add it at the start of your app.

IronPdf.License.LicenseKey = "YOUR-IRONPDF-LICENSE-KEY";
IronPdf.License.LicenseKey = "YOUR-IRONPDF-LICENSE-KEY";
IronPdf.License.LicenseKey = "YOUR-IRONPDF-LICENSE-KEY"
$vbLabelText   $csharpLabel

4. Create Your First PDF

Add this at the top of your .cs file.

using IronPdf;
using IronPdf;
Imports IronPdf
$vbLabelText   $csharpLabel
Create a Blank PDF
Convert HTML String to PDF
Convert DOCX to PDF

The simplest way to create a PDF object uses just the width and height. This PdfDocument constructor creates a blank PDF, ready for customization.

using IronPdf;

PdfDocument pdf = new PdfDocument(270, 270);
pdf.SaveAs("blankPage.pdf");
using IronPdf;

PdfDocument pdf = new PdfDocument(270, 270);
pdf.SaveAs("blankPage.pdf");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Using ChromePdfRenderer.RenderHtmlAsPdf method, you can transform any HTML (including HTML5) into a PDF using the embedded Chromium engine.

using IronPdf;

IronPdf.ChromePdfRender
       .StaticRenderHtmlAsPdf("<p>Hello Word</p>")
       .SaveAs("string-to-pdf.pdf");
using IronPdf;

IronPdf.ChromePdfRender
       .StaticRenderHtmlAsPdf("<p>Hello Word</p>")
       .SaveAs("string-to-pdf.pdf");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Convert Word documents to PDF with the DocxToPdfRenderer class, you can render DOCX files directly into customizable PDFs for seamless integration into .NET apps.

using IronPdf;

DocxToPdfRenderer renderer = new DocxToPdfRenderer();
PdfDocument pdf = renderer.RenderDocxAsPdf("Modern-chronological-resume.docx");
pdf.SaveAs("pdfFromDocx.pdf");
using IronPdf;

DocxToPdfRenderer renderer = new DocxToPdfRenderer();
PdfDocument pdf = renderer.RenderDocxAsPdf("Modern-chronological-resume.docx");
pdf.SaveAs("pdfFromDocx.pdf");
Imports IronPdf

Private renderer As New DocxToPdfRenderer()
Private pdf As PdfDocument = renderer.RenderDocxAsPdf("Modern-chronological-resume.docx")
pdf.SaveAs("pdfFromDocx.pdf")
$vbLabelText   $csharpLabel

5. More Advanced Examples

In addition to straightforward PDF creation and conversion, IronPDF also offers more powerful PDF customization options.

Add Headers and Footers
Redact Text
Merge PDFs

Create text headers or footers by instantiating TextHeaderFooter, adding your text, and attaching it to the PDF.

using IronPdf;

ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Hello World!</h1>");

// Create text header
TextHeaderFooter textHeader = new TextHeaderFooter
{
    CenterText = "This is the header!",
};

// Create text footer
TextHeaderFooter textFooter = new TextHeaderFooter
{
    CenterText = "This is the footer!",
};

// Add text header and footer to the PDF
pdf.AddTextHeaders(textHeader);
pdf.AddTextFooters(textFooter);

pdf.SaveAs("addTextHeaderFooter.pdf");
using IronPdf;

ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Hello World!</h1>");

// Create text header
TextHeaderFooter textHeader = new TextHeaderFooter
{
    CenterText = "This is the header!",
};

// Create text footer
TextHeaderFooter textFooter = new TextHeaderFooter
{
    CenterText = "This is the footer!",
};

// Add text header and footer to the PDF
pdf.AddTextHeaders(textHeader);
pdf.AddTextFooters(textFooter);

pdf.SaveAs("addTextHeaderFooter.pdf");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Redact text with ease using RedactTextOnAllPages to remove a phrase across the entire document.

using IronPdf;

PdfDocument pdf = PdfDocument.FromFile("novel.pdf");

// Redact 'Alaric' phrase from all pages
pdf.RedactTextOnAllPages("Alaric");

pdf.SaveAs("redacted.pdf");
using IronPdf;

PdfDocument pdf = PdfDocument.FromFile("novel.pdf");

// Redact 'Alaric' phrase from all pages
pdf.RedactTextOnAllPages("Alaric");

pdf.SaveAs("redacted.pdf");
Imports IronPdf

Private pdf As PdfDocument = PdfDocument.FromFile("novel.pdf")

' Redact 'Alaric' phrase from all pages
pdf.RedactTextOnAllPages("Alaric")

pdf.SaveAs("redacted.pdf")
$vbLabelText   $csharpLabel

Merge two PDF files in C# with the Merge method. Use ReplaceTextOnAllPages on any PdfDocument, new or imported, to swap old text with new.

using IronPdf;

ChromePdfRenderer renderer = new ChromePdfRenderer();

PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>.NET6</h1>");

string oldText = ".NET6";
string newText = ".NET7";

// Replace text on all pages
pdf.ReplaceTextOnAllPages(oldText, newText);

pdf.SaveAs("replaceText.pdf");
using IronPdf;

ChromePdfRenderer renderer = new ChromePdfRenderer();

PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>.NET6</h1>");

string oldText = ".NET6";
string newText = ".NET7";

// Replace text on all pages
pdf.ReplaceTextOnAllPages(oldText, newText);

pdf.SaveAs("replaceText.pdf");
Imports IronPdf

Private renderer As New ChromePdfRenderer()

Private pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>.NET6</h1>")

Private oldText As String = ".NET6"
Private newText As String = ".NET7"

' Replace text on all pages
pdf.ReplaceTextOnAllPages(oldText, newText)

pdf.SaveAs("replaceText.pdf")
$vbLabelText   $csharpLabel

Quick Troubleshooting

Issue Solution
Missing Visual C++ Runtime Install Visual C++ Redistributable - both x86 and x64 versions required for the Chrome engine
License not recognized Verify with IronPdf.License.IsLicensed property. Ensure license is applied before any IronPDF operations
Slow first render Call IronPdf.Installation.Initialize() at startup to pre-initialize rendering engines
Linux/Docker dependencies Set Installation.LinuxAndDockerDependenciesAutoConfig = true for automatic dependency installation

Next Steps


Preguntas Frecuentes

¿Cómo puedo configurar IronPdfEngine para la generación remota de PDF?

Para configurar IronPdfEngine para la generación remota de PDF, instala el paquete IronPdf.Slim desde NuGet y configura las configuraciones de conexión usando la clase IronPdfConnectionConfiguration. Esta configuración te permite conectar tu aplicación a la instancia de IronPdfEngine remotamente.

¿Cuáles son los principales beneficios de usar IronPdfEngine con mi aplicación?

Usar IronPdfEngine con tu aplicación permite la ejecución remota de tareas PDF, ayudando a evitar problemas de compatibilidad específicos de la plataforma, especialmente en sistemas más antiguos y plataformas móviles. También elimina la necesidad del tiempo de ejecución de .NET durante la ejecución.

¿Por qué podría elegir usar IronPdfEngine en lugar de la biblioteca PDF nativa?

Podrías elegir IronPdfEngine para ejecutar funciones PDF intensivas en rendimiento de forma remota, reduciendo problemas de compatibilidad con diferentes sistemas operativos y mejorando el rendimiento al aprovechar un renderizador idéntico a Chrome para la conversión de HTML a PDF.

¿Es compatible el escalado horizontal en IronPdfEngine?

No, IronPdfEngine actualmente no admite el escalado horizontal, lo que significa que no puede ser equilibrado en carga entre múltiples instancias debido a la forma en que se manejan los archivos binarios de PDF en la memoria del servidor.

¿Puede ejecutarse IronPdfEngine en diferentes sistemas operativos?

IronPdfEngine está diseñado para ejecutarse en sistemas Linux usando contenedores Docker. Sin embargo, los archivos binarios son específicos de la plataforma, por lo que necesitas asegurarte de usar la versión correcta para tu sistema operativo.

¿Qué debo hacer si mis salidas de PDF son diferentes al usar IronPdfEngine?

Las salidas de PDF pueden variar ligeramente debido a comportamientos diferentes del sistema operativo. Para minimizar diferencias, asegúrate de estar usando la imagen Docker correcta y verifica cualquier configuración específica del sistema operativo que pueda afectar el renderizado.

¿Cómo aseguro que mi aplicación esté usando la versión correcta de IronPdfEngine?

Para asegurar la compatibilidad, cada versión de IronPDF requiere una versión correspondiente de IronPdfEngine. Asegúrate de actualizar ambos componentes simultáneamente para evitar problemas de versiones cruzadas.

¿Cuáles son las limitaciones al usar IronPdfEngine en Windows?

Al usar IronPdfEngine en Windows, necesitas contenedores de Linux para Docker y debes asegurarte de que el puerto del servidor sea accesible. Los binarios son específicos de la plataforma y se requiere cambiar a contenedores de Linux.

¿Cómo configuro IronPDF para conectar a un servidor remoto de IronPdfEngine?

Para configurar IronPDF para un servidor remoto, usa Installation.ConnectToIronPdfHost con el método IronPdf.GrpcLayer.IronPdfConnectionConfiguration.RemoteServer, especificando los detalles de IP y puerto del servidor.

¿Qué paquete debo usar para minimizar el tamaño de la aplicación al usar IronPdfEngine?

Deberías usar el paquete IronPdf.Slim de NuGet, ya que incluye solo los componentes necesarios para ejecutar IronPDF con IronPdfEngine, reduciendo así el tamaño de la aplicación.

Curtis Chau
Escritor Técnico

Curtis Chau tiene una licenciatura en Ciencias de la Computación (Carleton University) y se especializa en el desarrollo front-end con experiencia en Node.js, TypeScript, JavaScript y React. Apasionado por crear interfaces de usuario intuitivas y estéticamente agradables, disfruta trabajando con frameworks modernos y creando manuales bien ...

Leer más
¿Listo para empezar?
Nuget Descargas 16,133,208 | Versión: 2025.11 recién lanzado