Saltar al pie de página
USANDO IRONPDF

Alternativas a PDFium en C# Usando IronPDF

PDFium library is an open-source rendering engine developed by Google specifically for working with Portable Document Format (PDF) files, with or without images, including PNG, etc. However, IronPDF doesn't just use the PDFium rendering interface engine as its source code setup; it also builds on top of it to provide additional functionality, making it easier to write/test project source code without any errors or bugs. IronPDF adds support for converting HTML documents to PDF documents — something that the PDFium .NET SDK does not support out of the box.

IronPDF uses the power of the open-source technology provided by PDFium to provide customers with a comprehensive set of tools needed for developing interactive Microsoft .NET Windows Applications that work with PDF files in some way. This includes converting HTML files into PDF files, splitting or merging PDF pages, extracting text from PDF documents, adding signatures or watermarks to a PDF file, filling out PDF forms, printing PDFs, etc.

IronPDF Creates Better PDF Files than PDFium Does

IronPDF has made significant improvements over PDFium in terms of creating PDFs. While PDFium can create and load basic PDFs, it lacks many features that users expect from a modern PDF document library. IronPDF addresses this shortcoming with an easy-to-use API for creating complex PDFs with headers and footers, page count, page numbers, bookmarks, watermarks, and much more.

IronPDF allows users to define custom paper sizes for PDF rendering. Here's a look at a sample code:

// Create a ChromePdfRenderer instance.
var renderer = new IronPdf.ChromePdfRenderer();

// Set the paper size to custom.
renderer.RenderingOptions.PaperSize = IronPdf.Rendering.PdfPaperSize.Custom;

// Define custom height and width for the PDF.
int height = 5;
int width = 5;

// Assign the custom dimensions to the rendering options.
renderer.RenderingOptions.SetCustomPaperSizeInInches(height, width);
// Create a ChromePdfRenderer instance.
var renderer = new IronPdf.ChromePdfRenderer();

// Set the paper size to custom.
renderer.RenderingOptions.PaperSize = IronPdf.Rendering.PdfPaperSize.Custom;

// Define custom height and width for the PDF.
int height = 5;
int width = 5;

// Assign the custom dimensions to the rendering options.
renderer.RenderingOptions.SetCustomPaperSizeInInches(height, width);
' Create a ChromePdfRenderer instance.
Dim renderer = New IronPdf.ChromePdfRenderer()

' Set the paper size to custom.
renderer.RenderingOptions.PaperSize = IronPdf.Rendering.PdfPaperSize.Custom

' Define custom height and width for the PDF.
Dim height As Integer = 5
Dim width As Integer = 5

' Assign the custom dimensions to the rendering options.
renderer.RenderingOptions.SetCustomPaperSizeInInches(height, width)
$vbLabelText   $csharpLabel

IronPDF Generates High-Quality Documents Quickly

When it comes to document generation, speed and memory are as important as quality. With IronPDF, you don't have to sacrifice one for the other. You can generate high-quality documents quickly from HTML files within an access directory.

Additional Environment Configurations

Building PDFium projects is not an easy task. It requires adding different modules and data for embedding PDFium. Unlike PDFium, IronPDF does not require any additional environment configuration or external dependencies. Instead, IronPDF includes all the necessary components as part of its core API. All related tools are installed automatically during IronPDF's installation.

Security Enhancements

IronPDF also offers enhancements to the security features in the library. It supports encrypting and decrypting PDF documents. It also provides several options for controlling what users can do with a document once it's been opened, such as printing, copying, and annotating.

Better Support and Documentation

IronPDF offers superior support and documentation compared to PDFium. If you encounter any issues while using IronPDF, our team is always available to assist. The comprehensive documentation, complete with images, makes it easy to start using IronPDF in your .NET applications.

How IronPDF is the Best Solution for Customers' Needs

IronPDF is the best solution for customers' needs because:

  • It integrates easily with any .NET Web Application.
  • It can create PDF files from HTML pages, CSS, and JavaScript files.
  • The IronPDF library is also useful for customers who need to extract data from a PDF document or make changes to an existing document and source code.
  • IronPDF offers excellent customer support and comprehensive documentation to help customers get started quickly.
  • A free trial is also available so customers can try out the library before making a purchase.

Learn more about using IronPDF in .NET applications using the following tutorial to convert HTML to PDF.

How Easy It Is to Use IronPDF

Consider the following demonstration to see just how easy it is to use IronPDF. Suppose you have a URL path that you need to convert to a PDF; the conversion process with IronPDF is straightforward. The class library abstracts all the details of using the underlying IronPDF library. Just add a reference to the IronPDF library or install it using the NuGet Package Manager and call the RenderUrlAsPdf method, passing in the URL path and the path where you want the PDF file to be saved using the SaveAs function. You can easily convert any URL to a PDF doc in just two lines of code.

// Create a ChromePdfRenderer instance and store it in a variable.
var renderer = new ChromePdfRenderer();

// Render the URL as a PDF.
var page = renderer.RenderUrlAsPdf("https://dotnet.microsoft.com/");

// Save the rendered PDF to the specified file path.
page.SaveAs("website.pdf");
// Create a ChromePdfRenderer instance and store it in a variable.
var renderer = new ChromePdfRenderer();

// Render the URL as a PDF.
var page = renderer.RenderUrlAsPdf("https://dotnet.microsoft.com/");

// Save the rendered PDF to the specified file path.
page.SaveAs("website.pdf");
' Create a ChromePdfRenderer instance and store it in a variable.
Dim renderer = New ChromePdfRenderer()

' Render the URL as a PDF.
Dim page = renderer.RenderUrlAsPdf("https://dotnet.microsoft.com/")

' Save the rendered PDF to the specified file path.
page.SaveAs("website.pdf")
$vbLabelText   $csharpLabel

PDFium in C# Alternatives Using IronPDF, Figure 1: IronPDF Output IronPDF Output

Conclusion

Building on top of the PDFium project has provided customers/developers with a reliable, up-to-date, and feature-rich PDF library. Our customers can be sure that their documents will look great, no matter what device or platform they are being viewed on. They can also take advantage of the powerful features that IronPDF code offers, making it easy for them to create, write, and share PDFs quickly and securely.

IronPDF offers a free trial period, so you can test out the software before making a purchase. Pricing starts at just $799, very affordable compared to other similar PDF rendering software. If you need to purchase multiple licenses, the company offers significant discounts. You can buy five product licenses for the price of just two by purchasing the Iron Suite.

Preguntas Frecuentes

¿Qué es PDFium y cómo se usa en aplicaciones .NET?

PDFium es un motor de renderizado de código abierto desarrollado por Google para trabajar con archivos PDF. En aplicaciones .NET, sirve como base para bibliotecas como IronPDF que extienden su funcionalidad para ofrecer capacidades mejoradas de gestión de PDF.

¿Cómo se puede convertir HTML a PDF en una aplicación .NET?

IronPDF proporciona métodos como RenderHtmlAsPdf para convertir cadenas HTML en documentos PDF. Simplifica el proceso de integrar la conversión de HTML a PDF en aplicaciones .NET.

¿Qué funcionalidades adicionales ofrece IronPDF sobre PDFium?

IronPDF extiende PDFium ofreciendo funcionalidades como conversión de HTML a PDF, división y fusión de PDFs, extracción de texto, adición de firmas o marcas de agua, y más, todo sin requerir configuraciones adicionales.

¿Puede IronPDF ser usado para cifrar documentos PDF?

Sí, IronPDF admite el cifrado y descifrado de documentos PDF, proporcionando opciones para controlar permisos de usuario como impresión y copia.

¿Cómo simplifica IronPDF el proceso de creación de documentos PDF complejos?

IronPDF ofrece una API fácil de usar que permite a los desarrolladores crear fácilmente PDFs complejos con características como encabezados personalizados, pies de página, marcadores y números de página, mejorando la productividad en aplicaciones .NET.

¿Se requiere alguna configuración adicional para usar IronPDF en aplicaciones .NET?

No, IronPDF integra todos los componentes necesarios dentro de su API principal, eliminando la necesidad de configuraciones adicionales o dependencias externas, a diferencia de PDFium estándar.

¿IronPDF ofrece soporte para tamaños de papel personalizados?

Sí, IronPDF admite tamaños de papel personalizados, permitiendo a los desarrolladores especificar las dimensiones de sus documentos PDF según sea necesario.

¿Qué opciones están disponibles para los desarrolladores para probar IronPDF antes de comprar?

IronPDF ofrece un periodo de prueba gratuito que permite a los desarrolladores probar sus características e integración con sus aplicaciones .NET antes de realizar una compra.

¿Cómo ayuda IronPDF en la conversión de URLs a documentos PDF?

El método RenderUrlAsPdf de IronPDF en la clase ChromePdfRenderer permite a los desarrolladores convertir páginas web de URLs directamente en documentos PDF, agilizando el archivado de contenido web.

¿Qué tipo de soporte al cliente proporciona IronPDF?

IronPDF ofrece excelente soporte al cliente, junto con documentación completa, para ayudar a los desarrolladores a utilizar efectivamente las amplias capacidades de la biblioteca.

¿IronPDF es totalmente compatible con .NET 10 y qué beneficios proporciona la compatibilidad con .NET 10?

Sí, IronPDF es totalmente compatible con .NET 10 y admite las últimas funciones de runtime y C#. Orientarse a .NET 10 ofrece ventajas como un mejor rendimiento (p. ej., reducción de asignaciones de montón, desvirtualización de métodos de interfaz de matriz), mejor uso de memoria, mejoras en toda la plataforma y compatibilidad con Windows, macOS, Linux, además de implementaciones en contenedores y en la nube. Esto garantiza que la creación y manipulación de PDF sean más rápidas, eficientes y estén preparadas para el futuro.

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