跳至页脚内容
产品比较

IronPDF和PDFium.NET之间的比较

With improving technology and the rise in internet usage, data is mostly sent and received in digital form, mainly in PDF files.

Working with PDF documents in C# has been difficult for developers in the recent past. There are many scenarios in which developers need to incorporate PDF viewing and PDF generation capabilities in their applications. Keeping this in mind, many libraries have been developed to facilitate these and similar tasks.

This article is going to compare two of the most popular PDF libraries for .NET and .NET Core developers. 这两个库是:

  • The IronPDF .NET library
  • The PDFium.NET SDK library

IronPDF and PDFium.NET can create, manipulate, and print PDFs in .NET applications. The question that arises is: which library should be used? Going through this article will allow you to decide for yourself.

First, let's take a look at what the two libraries have to offer, and then we will move on to the comparison itself.

The PDFium.NET SDK Library and its features

PDFium.NET is used to create, modify, and view files as PDFs (portable document formats). It provides a high-level C#/VB.NET API for dynamic PDF creation on a web server and to implement Save as PDF feature in existing Desktop or Web applications.

Standout Features of PDFium.NET are:

  • Create PDFs from scratch, or from a collection of scanned images
  • Ready-to-go toolbars for editing, splitting, merging, and manipulating PDFs, including text extraction
  • Embed standalone Winforms or WPF PDF Viewer control supports zooming
  • Supports .NET 2.0+, .NET 6, Standard, Core, Mono, Microsoft Azure
  • And it also works on Windows XP and Mac OS
  • Supports the entire range of PDF rendering capabilities
  • High-performance PDF viewer based, searching, printing, and editing PDF files
  • Extremely fast text processing engine

IronPDF and its Main Features

The IronPDF .NET PDF library is tailor-made for developers, particularly for C# developers. With this amazing PDF library, you can easily incorporate PDF Viewing capabilities in your .NET projects.

IronPDF has a built-in Chromium Engine which can convert HTML to PDF very easily. This does not require any complicated, low-level APIs for manipulating PDF files. It can handle HTML source files like HTML documents, JavaScript files, and ASPX web pages.

IronPDF can customize PDFs with custom headers and footers, watermarks, and much more. It also makes reading PDF text and extracting graphics a piece of cake for developers.

Standout Features of IronPDF for .NET include:

  • Creation of PDF Documents using HTML4/5, CSS, and JavaScript
  • Loading URLs with custom network login credentials, user agents, proxies, cookies, HTTP headers, and form variables.
  • Programmatic completion of HTML/PDF form fields.
  • Extraction of text and graphics from PDF files
  • Updating PDF pages with new content.
  • Adding and customizing headers and footers to PDFs.
  • Merging and splitting of PDF documents.
  • Converting ASP.NET web forms to printable PDFs.
  • Convert HTML files/URLs to PDFs.
  • Printing PDF files without using Adobe Acrobat Reader.

IronPDF library is available for almost all operating systems and frameworks compatible with C#, including the following:

  • .NET Core 2.1, 3.0, 3.1, .NET 5, 6, and 7
  • .NET Standard 2.0 Compliant for Universal Compatibility
  • Azure、AWS、Docker、Linux、Windows

文章其余部分如下:

  1. IronPDF C# Library Installation
  2. PDFium.NET SDK Installation 3.创建 PDF 文档
  3. Create PDF from Multiple Images 5.数字签名 PDF 6.定价和许可 7.结论

1. IronPDF C# Library Installation

There are different ways to download and install the IronPDF library. The easiest methods are as follows:

  1. 使用 Visual Studio 2.开发人员命令提示符 3.直接下载 NuGet 软件包
  2. Download the IronPDF.DLL library

1.1. 使用 Visual Studio

In your Visual Studio project, from the "Tools" Menu or right-click your project in the Solution Explorer and select "Manage NuGet Packages". Both these options are shown below in the screenshots.

A Comparison between IronPDF and PDFium.NET, Figure 1: Accessing the NuGet Package Manager using the Tools Menu
A Comparison between IronPDF and PDFium.NET, Figure 2: Accessing the NuGet Package Manager using the Solution Explorer

Once the NuGet Package Manager is opened, browse for the IronPDF package and install it, as shown in the screenshot below.

A Comparison between IronPDF and PDFium.NET, Figure 3: Installing the IronPDF library using the NuGet Package Manager

1.2.使用开发人员命令提示符。

IronPDF can also be downloaded through the Developer Command Prompt. Follow the steps below:

  • Open the Developer Command Prompt or Package Manager Console from the Tools menu.
  • 键入以下命令:
Install-Package IronPdf
  • Press the Enter Key
  • This will download and install the library

1.3.直接下载 NuGet 软件包。

IronPDF can also be directly downloaded by visiting the NuGet IronPDF Package. 步骤如下

  • Look for Download Package and click on it.
  • The package will be downloaded and installed.

1.4. Install IronPDF by Downloading the library

You can also download the IronPDF.DLL file directly from IronPDF's package page.

A Comparison between IronPDF and PDFium.NET, Figure 4: Downloading the IronPDF library DLL from the IronPDF website

Reference the IronPDF library in your project by using the following steps:

  • Right-click the Solution in the Solution Explorer and Select References
  • 浏览 IronPDF.dll 库
  • Click OK!

全部完成了! IronPDF is downloaded and installed. We will now work on installing the PDFium.NET SDK library.

2. PDFium.NET Installation

We can install PDFium.NET using the NuGet Package Manager or by downloading the PDFium Windows Installer.

  • 在 Visual Studio 中打开 NuGet 包,就像我们在 IronPdf 中做的那样。
  • Search for PDFium.NET.SDK. Click on Install in your current project.
A Comparison between IronPDF and PDFium.NET, Figure 5: PDFium.NET Search
  • You can also use Package Manager Console to install. Follow the "Use Developer Command Prompt" step as mentioned for IronPDF and type the following command:
Install-Package Pdfium.Net.SDK
  • Press Enter. This will download and install the library.

3.创建 PDF 文档

3.1.使用 IronPDF.

IronPDF provides multiple methods for generating PDF files. 让我们来看两个重要的例子。

将现有 URL 转换为 PDF.

IronPDF makes it very simple to convert HTML to PDF with IronPDF's URL rendering using existing URLs.

Consider the following source code.

IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();

// Use RenderUrlAsPdf method to convert a given URL to a PDF document
using var Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/");

// Save the generated PDF document
Pdf.SaveAs("url.pdf");
IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();

// Use RenderUrlAsPdf method to convert a given URL to a PDF document
using var Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/");

// Save the generated PDF document
Pdf.SaveAs("url.pdf");
Dim Renderer As New IronPdf.ChromePdfRenderer()

' Use RenderUrlAsPdf method to convert a given URL to a PDF document
Dim Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/")

' Save the generated PDF document
Pdf.SaveAs("url.pdf")
$vbLabelText   $csharpLabel

将 HTML 输入字符串转换为 PDF 文件

The following code snippet shows how an HTML string can be used to render a PDF page. You can use simple HTML, or combine it with CSS, images, and JavaScript.

var Renderer = new IronPDF.ChromePdfRenderer();

// Render HTML as a PDF
using var PDF = Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>");
PDF.SaveAs("pixel-perfect.pdf");

// Load external HTML assets: images, css, and javascript
// An optional BasePath 'C:\site\assets\' is set as the file location to load assets from
using var AdvancedPDF = Renderer.RenderHtmlAsPdf("<img src='logo_square.png'>", @"e:\site\assets\");
AdvancedPDF.SaveAs("html-with-assets.pdf");
var Renderer = new IronPDF.ChromePdfRenderer();

// Render HTML as a PDF
using var PDF = Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>");
PDF.SaveAs("pixel-perfect.pdf");

// Load external HTML assets: images, css, and javascript
// An optional BasePath 'C:\site\assets\' is set as the file location to load assets from
using var AdvancedPDF = Renderer.RenderHtmlAsPdf("<img src='logo_square.png'>", @"e:\site\assets\");
AdvancedPDF.SaveAs("html-with-assets.pdf");
Dim Renderer = New IronPDF.ChromePdfRenderer()

' Render HTML as a PDF
Dim PDF = Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>")
PDF.SaveAs("pixel-perfect.pdf")

' Load external HTML assets: images, css, and javascript
' An optional BasePath 'C:\site\assets\' is set as the file location to load assets from
Dim AdvancedPDF = Renderer.RenderHtmlAsPdf("<img src='logo_square.png'>", "e:\site\assets\")
AdvancedPDF.SaveAs("html-with-assets.pdf")
$vbLabelText   $csharpLabel

译文如下:

A Comparison between IronPDF and PDFium.NET, Figure 6: IronPDF Generate PDF from URL and HTML String

3.2. Using PDFium.NET

It can generate PDF documents on the fly using images and text objects. However, it is unable to convert a URL or HTML string to a PDF file.

Below is an example code for generating PDFs using building PDFium.NET:

public void CreatePDF()
{
    // Step 1: Initialize PDF library and create an empty document
    PdfCommon.Initialize();
    var doc = PdfDocument.CreateNew();  // Create a new PDF document

    // Step 2: Add a new page
    // Arguments: page width: 8.27", page height: 11.69", Unit of measure: inches
    //  The PDF unit of measure is a point. There are 72 points in one inch.
    var page = doc.Pages.InsertPageAt(doc.Pages.Count, 8.27f * 72, 11.69f * 72);

    // Step 3: Add graphics and text contents to the page
    // Insert image from file using the standard System.Drawing.Bitmap class
    using (PdfBitmap logo = PdfBitmap.FromFile(@"e:\site\assets\logo_square.png"))
    {
        PdfImageObject imageObject = PdfImageObject.Create(doc, logo, 0, 0);
        // Set image resolution to 300 DPI and location to 1.69 x 10.0 inches
        imageObject.Matrix = new FS_MATRIX(logo.Width * 72 / 300, 0, 0, logo.Height * 72 / 300, 1.69 * 72, 10.0 * 72);
        page.PageObjects.Add(imageObject);
    }

    // Create fonts for text objects
    PdfFont calibryBold = PdfFont.CreateFont(doc, "CalibriBold");
    // Insert text objects at 7.69"; 11.02" and font size is 25
    PdfTextObject textObject = PdfTextObject.Create("Sample text", 7.69f * 72, 11.02f * 72, calibryBold, 25);
    textObject.FillColor = FS_COLOR.Black;
    page.PageObjects.Add(textObject);

    // Step 5: Generate page content and save PDF file
    // Argument: PDF file name
    page.GenerateContent();
    doc.Save(@"e:\site\sample_document.pdf", SaveFlags.NoIncremental);
}
public void CreatePDF()
{
    // Step 1: Initialize PDF library and create an empty document
    PdfCommon.Initialize();
    var doc = PdfDocument.CreateNew();  // Create a new PDF document

    // Step 2: Add a new page
    // Arguments: page width: 8.27", page height: 11.69", Unit of measure: inches
    //  The PDF unit of measure is a point. There are 72 points in one inch.
    var page = doc.Pages.InsertPageAt(doc.Pages.Count, 8.27f * 72, 11.69f * 72);

    // Step 3: Add graphics and text contents to the page
    // Insert image from file using the standard System.Drawing.Bitmap class
    using (PdfBitmap logo = PdfBitmap.FromFile(@"e:\site\assets\logo_square.png"))
    {
        PdfImageObject imageObject = PdfImageObject.Create(doc, logo, 0, 0);
        // Set image resolution to 300 DPI and location to 1.69 x 10.0 inches
        imageObject.Matrix = new FS_MATRIX(logo.Width * 72 / 300, 0, 0, logo.Height * 72 / 300, 1.69 * 72, 10.0 * 72);
        page.PageObjects.Add(imageObject);
    }

    // Create fonts for text objects
    PdfFont calibryBold = PdfFont.CreateFont(doc, "CalibriBold");
    // Insert text objects at 7.69"; 11.02" and font size is 25
    PdfTextObject textObject = PdfTextObject.Create("Sample text", 7.69f * 72, 11.02f * 72, calibryBold, 25);
    textObject.FillColor = FS_COLOR.Black;
    page.PageObjects.Add(textObject);

    // Step 5: Generate page content and save PDF file
    // Argument: PDF file name
    page.GenerateContent();
    doc.Save(@"e:\site\sample_document.pdf", SaveFlags.NoIncremental);
}
Public Sub CreatePDF()
	' Step 1: Initialize PDF library and create an empty document
	PdfCommon.Initialize()
	Dim doc = PdfDocument.CreateNew() ' Create a new PDF document

	' Step 2: Add a new page
	' Arguments: page width: 8.27", page height: 11.69", Unit of measure: inches
	'  The PDF unit of measure is a point. There are 72 points in one inch.
	Dim page = doc.Pages.InsertPageAt(doc.Pages.Count, 8.27F * 72, 11.69F * 72)

	' Step 3: Add graphics and text contents to the page
	' Insert image from file using the standard System.Drawing.Bitmap class
	Using logo As PdfBitmap = PdfBitmap.FromFile("e:\site\assets\logo_square.png")
		Dim imageObject As PdfImageObject = PdfImageObject.Create(doc, logo, 0, 0)
		' Set image resolution to 300 DPI and location to 1.69 x 10.0 inches
		imageObject.Matrix = New FS_MATRIX(logo.Width * 72 \ 300, 0, 0, logo.Height * 72 \ 300, 1.69 * 72, 10.0 * 72)
		page.PageObjects.Add(imageObject)
	End Using

	' Create fonts for text objects
	Dim calibryBold As PdfFont = PdfFont.CreateFont(doc, "CalibriBold")
	' Insert text objects at 7.69"; 11.02" and font size is 25
	Dim textObject As PdfTextObject = PdfTextObject.Create("Sample text", 7.69F * 72, 11.02F * 72, calibryBold, 25)
	textObject.FillColor = FS_COLOR.Black
	page.PageObjects.Add(textObject)

	' Step 5: Generate page content and save PDF file
	' Argument: PDF file name
	page.GenerateContent()
	doc.Save("e:\site\sample_document.pdf", SaveFlags.NoIncremental)
End Sub
$vbLabelText   $csharpLabel

译文如下:

A Comparison between IronPDF and PDFium.NET, Figure 7: PDFium.NET Generate PDF

If we compare the output of IronPDF to the PDFium project, we can clearly see that IronPDF's class library-based output gives better results using HTML rendering without the need to scale the image size. On the other hand, PDFium.NET provides a similar output to IronPDF but only with image scaling. If we skip the following line in the code:

imageObject.Matrix = new FS_MATRIX(logo.Width * 72 / 300, 0, 0, logo.Height * 72 / 300, 1.69 * 72, 10.0 * 72);
imageObject.Matrix = new FS_MATRIX(logo.Width * 72 / 300, 0, 0, logo.Height * 72 / 300, 1.69 * 72, 10.0 * 72);
imageObject.Matrix = New FS_MATRIX(logo.Width * 72 \ 300, 0, 0, logo.Height * 72 \ 300, 1.69 * 72, 10.0 * 72)
$vbLabelText   $csharpLabel

The output will be:

A Comparison between IronPDF and PDFium.NET, Figure 8: PDFium.NET Output without image scaling PDF

4. Create PDF from Multiple Images

4.1.使用 IronPDF.

Merging two or more PDFs is easy in IronPDF. Using the Merge method, you can combine two or more PDFs where each file is separated by a comma. 代码如下:

using IronPdf;

var html_a = @"<p> [PDF_A] </p>
                <p> [PDF_A] 1st Page </p>
                <div style = 'page-break-after: always;'></div>
                <p> [PDF_A] 2nd Page</p>";

var html_b = @"<p> [PDF_B] </p>
                <p> [PDF_B] 1st Page </p>
                <div style = 'page-break-after: always;'></div>
                <p> [PDF_B] 2nd Page</p>";

var Renderer = new IronPDF.ChromePdfRenderer();

// Render HTML documents as PDFs
var pdfdoc_a = Renderer.RenderHtmlAsPdf(html_a);
var pdfdoc_b = Renderer.RenderHtmlAsPdf(html_b);

// Merge the documents into one PDF
var merged = IronPDF.PdfDocument.Merge(pdfdoc_a, pdfdoc_b);

// Save the merged document
merged.SaveAs("Merged.PDF");
using IronPdf;

var html_a = @"<p> [PDF_A] </p>
                <p> [PDF_A] 1st Page </p>
                <div style = 'page-break-after: always;'></div>
                <p> [PDF_A] 2nd Page</p>";

var html_b = @"<p> [PDF_B] </p>
                <p> [PDF_B] 1st Page </p>
                <div style = 'page-break-after: always;'></div>
                <p> [PDF_B] 2nd Page</p>";

var Renderer = new IronPDF.ChromePdfRenderer();

// Render HTML documents as PDFs
var pdfdoc_a = Renderer.RenderHtmlAsPdf(html_a);
var pdfdoc_b = Renderer.RenderHtmlAsPdf(html_b);

// Merge the documents into one PDF
var merged = IronPDF.PdfDocument.Merge(pdfdoc_a, pdfdoc_b);

// Save the merged document
merged.SaveAs("Merged.PDF");
Imports IronPdf

Private html_a = "<p> [PDF_A] </p>
                <p> [PDF_A] 1st Page </p>
                <div style = 'page-break-after: always;'></div>
                <p> [PDF_A] 2nd Page</p>"

Private html_b = "<p> [PDF_B] </p>
                <p> [PDF_B] 1st Page </p>
                <div style = 'page-break-after: always;'></div>
                <p> [PDF_B] 2nd Page</p>"

Private Renderer = New IronPDF.ChromePdfRenderer()

' Render HTML documents as PDFs
Private pdfdoc_a = Renderer.RenderHtmlAsPdf(html_a)
Private pdfdoc_b = Renderer.RenderHtmlAsPdf(html_b)

' Merge the documents into one PDF
Private merged = IronPDF.PdfDocument.Merge(pdfdoc_a, pdfdoc_b)

' Save the merged document
merged.SaveAs("Merged.PDF")
$vbLabelText   $csharpLabel

4.2. Using PDFium.NET

Using PDFium.NET, you can not only merge multiple PDF files into a single file, but also select specific pages from the source files and combine them into one PDF document.

The code below shows how it can be done using the ImportPages method:

public void MergePDF()
{
    // Initialize the SDK library.
    PdfCommon.Initialize();

    // Open and load a PDF document into which other files will be merged 
    using (var mainDoc = PdfDocument.Load(@"c:\test001.pdf")) // Read source PDF File #1
    {
        // Open one PDF document.
        using (var doc = PdfDocument.Load(@"c:\doc1.pdf")) // Read PDF File #2
        {
            // Import all pages from the document
            mainDoc.Pages.ImportPages(
                doc,
                string.Format("1-{0}", doc.Pages.Count),
                mainDoc.Pages.Count
                );
        }

        // Open another PDF document.
        using (var doc = PdfDocument.Load(@"c:\doc2.pdf"))
        {
            // Import all pages from the document
            mainDoc.Pages.ImportPages(
                doc,
                string.Format("1-{0}", doc.Pages.Count),
                mainDoc.Pages.Count
                );
        }

        // Save the merged document
        mainDoc.Save(@"c:\ResultDocument.pdf", SaveFlags.NoIncremental);
    }
}
public void MergePDF()
{
    // Initialize the SDK library.
    PdfCommon.Initialize();

    // Open and load a PDF document into which other files will be merged 
    using (var mainDoc = PdfDocument.Load(@"c:\test001.pdf")) // Read source PDF File #1
    {
        // Open one PDF document.
        using (var doc = PdfDocument.Load(@"c:\doc1.pdf")) // Read PDF File #2
        {
            // Import all pages from the document
            mainDoc.Pages.ImportPages(
                doc,
                string.Format("1-{0}", doc.Pages.Count),
                mainDoc.Pages.Count
                );
        }

        // Open another PDF document.
        using (var doc = PdfDocument.Load(@"c:\doc2.pdf"))
        {
            // Import all pages from the document
            mainDoc.Pages.ImportPages(
                doc,
                string.Format("1-{0}", doc.Pages.Count),
                mainDoc.Pages.Count
                );
        }

        // Save the merged document
        mainDoc.Save(@"c:\ResultDocument.pdf", SaveFlags.NoIncremental);
    }
}
Public Sub MergePDF()
	' Initialize the SDK library.
	PdfCommon.Initialize()

	' Open and load a PDF document into which other files will be merged 
	Using mainDoc = PdfDocument.Load("c:\test001.pdf") ' Read source PDF File #1
		' Open one PDF document.
		Using doc = PdfDocument.Load("c:\doc1.pdf") ' Read PDF File #2
			' Import all pages from the document
			mainDoc.Pages.ImportPages(doc, String.Format("1-{0}", doc.Pages.Count), mainDoc.Pages.Count)
		End Using

		' Open another PDF document.
		Using doc = PdfDocument.Load("c:\doc2.pdf")
			' Import all pages from the document
			mainDoc.Pages.ImportPages(doc, String.Format("1-{0}", doc.Pages.Count), mainDoc.Pages.Count)
		End Using

		' Save the merged document
		mainDoc.Save("c:\ResultDocument.pdf", SaveFlags.NoIncremental)
	End Using
End Sub
$vbLabelText   $csharpLabel

5.数字签名 PDF

5.1.使用 IronPDF.

One of the most important features nowadays is signing a PDF document digitally. IronPDF provides this facility. 代码如下

using IronPdf;

// Cryptographically sign an existing PDF in 1 line of code!
new IronPDF.Signing.PdfSignature("Iron.p12", "123456").SignPdfFile("any.pdf");

/***** Advanced example for more control *****/

// Step 1. Create a PDF
var Renderer = new IronPdf.ChromePdfRenderer();
var doc = Renderer.RenderHtmlAsPDF("<h1>Testing 2048 bit digital security</h1>");

// Step 2. Create a Signature.
// You may create a .pfx or .p12 PDF signing certificate using Adobe Acrobat Reader.

var signature = new IronPDF.Signing.PdfSignature("Iron.pfx", "123456");

// Step 3. Handwritten signature graphic
signature.LoadSignatureImageFromFile("handwriting.png");

// Step 4. Sign the PDF with the PDFSignature. Multiple signing certificates may be used
doc.SignPdfWithDigitalSignature(signature);

// Step 4. The PDF is not signed until saved to file, stream, or byte array.
doc.SaveAs("signed.pdf"); 
using IronPdf;

// Cryptographically sign an existing PDF in 1 line of code!
new IronPDF.Signing.PdfSignature("Iron.p12", "123456").SignPdfFile("any.pdf");

/***** Advanced example for more control *****/

// Step 1. Create a PDF
var Renderer = new IronPdf.ChromePdfRenderer();
var doc = Renderer.RenderHtmlAsPDF("<h1>Testing 2048 bit digital security</h1>");

// Step 2. Create a Signature.
// You may create a .pfx or .p12 PDF signing certificate using Adobe Acrobat Reader.

var signature = new IronPDF.Signing.PdfSignature("Iron.pfx", "123456");

// Step 3. Handwritten signature graphic
signature.LoadSignatureImageFromFile("handwriting.png");

// Step 4. Sign the PDF with the PDFSignature. Multiple signing certificates may be used
doc.SignPdfWithDigitalSignature(signature);

// Step 4. The PDF is not signed until saved to file, stream, or byte array.
doc.SaveAs("signed.pdf"); 
Imports IronPdf

' Cryptographically sign an existing PDF in 1 line of code!
Call (New IronPDF.Signing.PdfSignature("Iron.p12", "123456")).SignPdfFile("any.pdf")

'''*** Advanced example for more control ****

' Step 1. Create a PDF
Dim Renderer = New IronPdf.ChromePdfRenderer()
Dim doc = Renderer.RenderHtmlAsPDF("<h1>Testing 2048 bit digital security</h1>")

' Step 2. Create a Signature.
' You may create a .pfx or .p12 PDF signing certificate using Adobe Acrobat Reader.

Dim signature = New IronPDF.Signing.PdfSignature("Iron.pfx", "123456")

' Step 3. Handwritten signature graphic
signature.LoadSignatureImageFromFile("handwriting.png")

' Step 4. Sign the PDF with the PDFSignature. Multiple signing certificates may be used
doc.SignPdfWithDigitalSignature(signature)

' Step 4. The PDF is not signed until saved to file, stream, or byte array.
doc.SaveAs("signed.pdf")
$vbLabelText   $csharpLabel

PDFium.NET lacks this ability to digitally sign PDF documents.

6.定价和许可

IronPDF 定价和许可

IronPDF is free to use for developing simple applications and can be licensed for commercial use at any time. It provides single project licenses, single developer licenses, agencies, and multinational organizations licenses. It also provides SaaS and OEM redistribution licenses and support.

All IronPDF licenses are available with a 30-day money-back guarantee, plus a year of software support and upgrades. Most importantly, it is a perpetual license (one-time purchase). The Lite package is available. There are absolutely no recurring fees with IronPDF products. More detailed information about the available licenses is on the IronPDF Licensing page.

A Comparison between IronPDF and PDFium.NET, Figure 9: IronPDF Licensing

PDFium.NET Pricing and Licensing

PDFium.NET provides a perpetual license. You can use this supported SDK version with your registration key forever. However, the key only works with some specific SDK versions that depend on the date of license purchase or renewal. You can install any new product version for free, provided that it was released before or within one year of your purchase. PDFium.NET also provides 3 different license packages:

  • Single Project License is designed for single developers and small teams working on one project. Starting from $720.
  • Organization License is designed for development teams working on multiple projects.
  • Single Developer License is designed for single developers and freelancers working for multiple clients.

You can visit the PDFium.NET Purchase page for complete pricing details.

结论

The IronPDF library is an easy-to-use library for creating PDF documents without any complicated APIs. The built-in chromium engine allows pixel-perfect HTML to PDF conversion with open standard document types such as HTML, JS, CSS, JPG, PNG, GIF, and SVG.

PDFium.NET SDK is a .NET class library designed to fulfill most common needs a developer has for a more than affordable price. With PDFium.NET SDK, your apps can display and manipulate PDF documents like a charm. Its special Page object editing API is what makes this library particularly powerful.

PDFium.NET licenses come in three editions as mentioned above. The single project license provides facilities for single developer and up to three developers starting from $720 and $900 respectively. This is somewhat cheaper than IronPDF, which has a lite version starting at a lower price.

IronPDF offers an unlimited license at a competitive price. In contrast, PDFium.NET has an organizational license for an unlimited number of developers for a premium price. On the contrary, IronPDF provides a professional license that can be used by 10 developers, and is about half of PDFium.NET's equivalent license for 10 developers.

In the examples above, you have seen IronPDF create and modify PDF documents using much fewer lines of code compared to PDFium.NET. This helps to ease the workload of the developer and allows them to be more productive. IronPDF provides multiple methods to convert from almost any format to PDF. In contrast, PDFium.NET only offers a few methods like images and text to PDF.

You can now purchase all of Iron Software's product libraries for just the price of two of them. Additionally, there is a free trial to test the functionality.

[{i:(PDFium.NET is a registered trademark of its respective owner. This site is not affiliated with, endorsed by, or sponsored by PDFium.NET. 所有产品名称、徽标和品牌均为其各自所有者的财产。 比较仅供参考,反映的是撰写时的公开信息。]

常见问题解答

如何在C#中将HTML转换为PDF?

您可以使用 IronPDF 的 RenderHtmlAsPdf 方法将 HTML 字符串转换为 PDF。此外,您还可以使用 RenderHtmlFileAsPdf 方法将 HTML 文件转换为 PDF。

IronPDF 处理 PDF 的主要功能是什么?

IronPDF 允许开发者使用 HTML、CSS 和 JavaScript 创建 PDF 文档。 它具有 URL 转换为 PDF、文本和图形提取、自定义页眉和页脚、PDF 合并和拆分以及无需 Adobe Acrobat Reader 即可打印 PDF 的功能。

IronPDF 可以对 PDF 文档进行数字签名吗?

是的,IronPDF 支持数字签名,使您可以使用加密签名保护 PDF 文档。

IronPDF有哪些安装选项?

IronPDF 可以通过 Visual Studio、开发者命令提示符下载 NuGet 包或获取 IronPDF.DLL 库来安装。

IronPDF 提供哪些许可和定价选项?

IronPDF 提供多种许可选项,包括单个项目、单个开发人员、代理机构和跨国组织许可证。 它还提供 SaaS 和 OEM 重新分发许可证,均提供 30 天退款保证。

IronPDF 如何提高开发效率?

IronPDF 设计为比其他库(如 PDFium.NET)需要更少的代码行数来创建和修改 PDF 文档,从而提高开发人员的生产力。

IronPDF 是否支持跨平台 PDF 功能?

是的,IronPDF 支持多种操作系统和框架,使其成为具有多功能性的跨平台 PDF 功能的理想选择。

与其他 PDF 库相比,使用 IronPDF 有哪些优点?

IronPDF 易于使用,具有 HTML 转 PDF 转换等强大的功能,以及具有竞争力的价格,使其成为许多开发人员优于其他 PDF 库的首选。

Curtis Chau
技术作家

Curtis Chau 拥有卡尔顿大学的计算机科学学士学位,专注于前端开发,精通 Node.js、TypeScript、JavaScript 和 React。他热衷于打造直观且美观的用户界面,喜欢使用现代框架并创建结构良好、视觉吸引力强的手册。

除了开发之外,Curtis 对物联网 (IoT) 有浓厚的兴趣,探索将硬件和软件集成的新方法。在空闲时间,他喜欢玩游戏和构建 Discord 机器人,将他对技术的热爱与创造力相结合。