푸터 콘텐츠로 바로가기
제품 비교

A Comparison between IronPDF and PDFNet

1. Introduction

Looking for the perfect PDF tools for the .NET Framework?

In this article, we will take a look at how to work with PDF files in C# (one of the most popular programming languages). We will discuss two industry-leading PDF tools for C# on the .NET Framework, using code samples to compare them based on their performance and features. In the end, we will examine their licensing details and learn how to obtain license keys.

The two PDF libraries are:

  • PDFNet
  • IronPDF

2. IronPDF

IronPDF is a C# .NET library developed by Iron Software to solve all PDF problems for C# .NET developers using a single library. IronPDF is powered by a Chromium engine and has a variety of helpful and powerful capabilities such as the conversion of HTML5, JavaScript, CSS, and image files to PDF, creating custom headers and footers, and displaying PDFs precisely as they appear in a browser. IronPDF allows you to read data from PDF files and insert it into your .NET applications and data storage systems automatically. You can import, move, and index content from old PDF document storage into your document management and business applications.

2.1. IronPDF Features

2.1.1. PDF Conversions

This functionality allows you to generate PDF files from various formats such as HTML, MVC views, Web Forms, HTML Strings, and URLs.

2.1.2. Extraction of PDF Content

In many circumstances, you can easily extract embedded text from PDFs. However, if that fails, your text is most likely embedded in an image. To scan documents for visual text, rather than plain text, use the IronOCR library.

Headers and footers can be added while creating a PDF or to existing PDFs. Using the Print Options property, you may create a header and footer for each document page. These parameters are available on the ChromePdfRenderer object. This example runs within a .NET Core console app.

2.1.4. PDF Image Processing

This enables users to generate images from PDFs as well as PDFs from photographs. It supports image extraction, various image extensions, and PDF printing.

2.1.5. PDF Documents IO

IronPDF also includes 128-bit PDF encryption, password-protected PDF locking, and the digital signing of PDFs.

2.1.6. PDF Editing

IronPDF tool allows you to add watermarks, add pages, remove pages, backgrounds, foregrounds, and much more to your PDFs.

2.1.7. Compatibility

IronPDF supports almost all operating systems and frameworks compatible with C#, such as:

  • Windows
  • .NET Core 2.1, 3.0, 3.1, .NET 6 & 5
  • .NET Standard 2.0 Compliance for Universal Compatibility
  • Azure
  • AWS
  • Docker
  • Linux

3. PDFNet

PDFNet .NET SDK by PDFTron brings precise PDF processing, annotation, editing, and creation to any framework or application on the web, mobile, desktop, or server. It manages the entire document and information management process with your infrastructure and eliminates the need for third-party server dependencies. PDFTron's web platform comes with a JS version with the supported platform and a demo license key for all the PDF SDKs.

One of the most significant benefits of PDFNet is that it is genuinely cross-platform, allowing our users to simply add PDF compatibility and relevant business functionality to their workflows and apps across many distinct mobile and desktop contexts, all while using virtually the same interface.

3.1. PDFNet SDK Features

3.1.1. Compatibility

The PDFNet SDK is compatible with many platforms and frameworks. To ensure platform consistency, the JavaScript API is utilized in the same way as the PDFNet API. Node.js and Electron versions of the SDK are also available. This package requires unmanaged add-on binaries.

3.1.2. Editing and Viewing

Brings safe, scalable, and high-fidelity reading and editing abilities for PDFs to users across online, mobile, and desktop platforms.

3.1.3. Signing

Create customized signing procedures. Digitally signed papers can be certified, validated, and sealed.

3.1.4. True Redaction

Remove sensitive data from documents, such as personal information or personal health information, while leaving the document searchable.

3.1.5. Manipulation of the Page

Pages can be added, removed, or rearranged. Documents may be assembled, merged, or divided into parts. View several documents simultaneously in the same reader or beside each other.

4. Creating a New Project in Visual Studio

In this article, we are going to use a console application to generate PDF documents.

Open the Visual Studio software and go to the File menu. Select "new project" and then select console application.

Enter the project name and select the path in the appropriate text box. Then, click the create button. Select the required .NET framework, as in the screenshot below:

A Comparison Between IronPDF and PDFNet, Figure 1

The Visual Studio project will now generate the structure for the console application. Once finished, it will open the Program.cs file, in which you can write and execute source code.

A Comparison Between IronPDF and PDFNet, Figure 2

Now we can add the library and test the program.

5. Install the IronPDF Library

The IronPDF library can be downloaded and installed in four different ways. These are:

5.1 Using the Visual Studio NuGet Package Manager

The Visual Studio software provides the NuGet Package Manager option to install the package directly to the solution. The below screenshot shows how to open the NuGet Package Manager.

A Comparison Between IronPDF and PDFNet, Figure 3

With the Package Manager GUI open, click on the Browse tab and search for "IronPDF:"

A Comparison Between IronPDF and PDFNet, Figure 4

In the above image, we can see the list of related packages from the search. Select the IronPDF option and install the package to our solution.

5.2 Using the Visual Studio Command-Line

  • In the Visual Studio menu, Go to Tools > NuGet Package manager > Package manager console
A Comparison Between IronPDF and PDFNet, Figure 5

  • Enter the following line in the package manager console tab:
Install-Package IronPdf

The IronPDF package will now be installed in the project.

A Comparison Between IronPDF and PDFNet, Figure 6

5.3 Direct Download from the NuGet Webpage

The third way is to download the NuGet package directly from the NuGet Gallery IronPDF Package.

  • Select the download package option from the menu on the right-hand side.
  • Double-click the downloaded package; it will be installed automatically.
  • Next, reload the solution and begin using it in the project.

5.4 Direct Download from the IronPDF Webpage

Download the latest package directly from the IronPDF Download Page. After the download, follow the steps below to add the package to the project.

  • Right-click the project from the solution window.
  • Then, select the options reference and browse the location of the downloaded reference.
  • Next, click OK to add the reference.

6. Install the PDFNet SDK

The PDFNet SDK can be downloaded and installed in four different ways.

  • Using the Visual Studio NuGet Package Manager.
  • Using the Visual Studio Command Line.
  • Direct Download from the NuGet Gallery PDFNet Package.
  • Using PDFNetLoader.dll

6.1. Using the Visual Studio NuGet Package Manager

As explained above, go to tools in Visual Studio and open the NuGet package manager. A list will appear — click on manage NuGet package for solutions.

A Comparison Between IronPDF and PDFNet, Figure 7

A window will appear with a search bar. Search for PDFNet and install it in the project.

6.2. Using the Visual Studio Command Line

  • In the Visual Studio menu, Go to Tools > NuGet Package manager > Package manager console
  • Enter the following line in the package manager console tab:
Install-Package PDFNet -Version 9.2.0
A Comparison Between IronPDF and PDFNet, Figure 8

6.3. Direct Download from the NuGet Webpage

The third way is to download the NuGet package directly from the NuGet Gallery PDFNet Package.

  • Choose the download package choice from the right-hand menu.
  • Double-click the downloaded package to start the installation process.

6.4. Using PDFNetLoader.dll

You can also install the PDFNet API using the PDFNetLoader.dll file. Download it from GitHub Releases for PDFNetLoader.dll.

Download the package, place it in the bin file of the project, and run it. In your Visual Studio project, add PDFNetLoader.dll as a reference.

Bootstrap and CSS Framework Rendering

Modern web applications rely heavily on Bootstrap and CSS frameworks for consistent, responsive design. When generating PDFs from web content, the ability to accurately render these frameworks without modification is essential for maintaining design consistency and reducing development effort.

IronPDF: Complete Bootstrap Framework Support

  • Bootstrap 5: Full flexbox layout system, CSS Grid, utility classes, and all component libraries
  • Bootstrap 4: Complete card components, navigation, flex utilities, and responsive design
  • Tailwind CSS: All utility-first classes render with browser accuracy
  • Foundation: Complete grid system and component support
  • Modern CSS3: Flexbox, CSS Grid, custom properties, animations, transitions, and transforms

Real-world validation: IronPDF renders the Bootstrap homepage and all official examples with pixel-perfect fidelity.

Code Example: Learning Management System Dashboard

using IronPdf;

// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";

var renderer = new ChromePdfRenderer();
string bootstrapLMS = @"
<!DOCTYPE html>
<html>
<head>
    <link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css' rel='stylesheet'>
</head>
<body>
    <div class='container-fluid py-4'>
        <div class='d-flex justify-content-between align-items-center mb-4'>
            <div>
                <h1>Student Learning Dashboard</h1>
                <p class='text-muted mb-0'>Spring Semester 2025</p>
            </div>
            <span class='badge bg-success fs-5'>92% Overall Progress</span>
        </div>

        <div class='row g-4 mb-4'>
            <div class='col-md-3'>
                <div class='card text-center shadow-sm border-primary'>
                    <div class='card-body'>
                        <div class='text-primary mb-2' style='font-size: 2rem;'>📚</div>
                        <h3>6/8</h3>
                        <p class='text-muted mb-0'>Courses Completed</p>
                    </div>
                </div>
            </div>
            <div class='col-md-3'>
                <div class='card text-center shadow-sm border-success'>
                    <div class='card-body'>
                        <div class='text-success mb-2' style='font-size: 2rem;'>🎯</div>
                        <h3>24/28</h3>
                        <p class='text-muted mb-0'>Assignments Submitted</p>
                    </div>
                </div>
            </div>
            <div class='col-md-3'>
                <div class='card text-center shadow-sm border-warning'>
                    <div class='card-body'>
                        <div class='text-warning mb-2' style='font-size: 2rem;'>⏱️</div>
                        <h3>48hrs</h3>
                        <p class='text-muted mb-0'>Study Time This Week</p>
                    </div>
                </div>
            </div>
            <div class='col-md-3'>
                <div class='card text-center shadow-sm border-info'>
                    <div class='card-body'>
                        <div class='text-info mb-2' style='font-size: 2rem;'>⭐</div>
                        <h3>A- Average</h3>
                        <p class='text-muted mb-0'>Current GPA: 3.7</p>
                    </div>
                </div>
            </div>
        </div>

        <div class='row g-4'>
            <div class='col-md-8'>
                <div class='card shadow-sm'>
                    <div class='card-header bg-primary text-white'>
                        <h5>Current Courses</h5>
                    </div>
                    <div class='card-body p-0'>
                        <div class='list-group list-group-flush'>
                            <div class='list-group-item'>
                                <div class='d-flex justify-content-between align-items-center mb-2'>
                                    <div>
                                        <h6>Advanced Web Development</h6>
                                        <small class='text-muted'>Prof. Johnson | Mondays & Wednesdays, 2:00 PM</small>
                                    </div>
                                    <span class='badge bg-success'>Grade: A</span>
                                </div>
                                <div class='progress' style='height: 6px;'>
                                    <div class='progress-bar bg-success' style='width: 95%'></div>
                                </div>
                                <small class='text-muted'>95% Complete | Final Project Due: May 15</small>
                            </div>

                            <div class='list-group-item'>
                                <div class='d-flex justify-content-between align-items-center mb-2'>
                                    <div>
                                        <h6>Database Systems</h6>
                                        <small class='text-muted'>Prof. Chen | Tuesdays & Thursdays, 10:00 AM</small>
                                    </div>
                                    <span class='badge bg-primary'>Grade: A-</span>
                                </div>
                                <div class='progress' style='height: 6px;'>
                                    <div class='progress-bar bg-primary' style='width: 88%'></div>
                                </div>
                                <small class='text-muted'>88% Complete | Midterm: April 28</small>
                            </div>

                            <div class='list-group-item'>
                                <div class='d-flex justify-content-between align-items-center mb-2'>
                                    <div>
                                        <h6>Artificial Intelligence Fundamentals</h6>
                                        <small class='text-muted'>Prof. Martinez | Fridays, 1:00 PM</small>
                                    </div>
                                    <span class='badge bg-warning text-dark'>Grade: B+</span>
                                </div>
                                <div class='progress' style='height: 6px;'>
                                    <div class='progress-bar bg-warning' style='width: 75%'></div>
                                </div>
                                <small class='text-muted'>75% Complete | Research Paper Due: May 5</small>
                            </div>

                            <div class='list-group-item'>
                                <div class='d-flex justify-content-between align-items-center mb-2'>
                                    <div>
                                        <h6>Computer Networks</h6>
                                        <small class='text-muted'>Prof. Davis | Mondays & Wednesdays, 4:00 PM</small>
                                    </div>
                                    <span class='badge bg-success'>Grade: A</span>
                                </div>
                                <div class='progress' style='height: 6px;'>
                                    <div class='progress-bar bg-success' style='width: 92%'></div>
                                </div>
                                <small class='text-muted'>92% Complete | Lab Exam: April 30</small>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class='col-md-4'>
                <div class='card shadow-sm mb-3'>
                    <div class='card-header bg-warning text-dark'>
                        <h5>Upcoming Deadlines</h5>
                    </div>
                    <div class='card-body p-0'>
                        <ul class='list-group list-group-flush'>
                            <li class='list-group-item'>
                                <div class='d-flex align-items-start'>
                                    <span class='badge bg-danger me-2'>Today</span>
                                    <div class='flex-grow-1'>
                                        <small><strong>AI Assignment 4</strong></small>
                                        <br><small class='text-muted'>Neural Networks Lab</small>
                                    </div>
                                </div>
                            </li>
                            <li class='list-group-item'>
                                <div class='d-flex align-items-start'>
                                    <span class='badge bg-warning text-dark me-2'>Apr 28</span>
                                    <div class='flex-grow-1'>
                                        <small><strong>Database Midterm</strong></small>
                                        <br><small class='text-muted'>Chapters 1-8</small>
                                    </div>
                                </div>
                            </li>
                            <li class='list-group-item'>
                                <div class='d-flex align-items-start'>
                                    <span class='badge bg-info me-2'>Apr 30</span>
                                    <div class='flex-grow-1'>
                                        <small><strong>Networks Lab Exam</strong></small>
                                        <br><small class='text-muted'>Practical Assessment</small>
                                    </div>
                                </div>
                            </li>
                            <li class='list-group-item'>
                                <div class='d-flex align-items-start'>
                                    <span class='badge bg-primary me-2'>May 5</span>
                                    <div class='flex-grow-1'>
                                        <small><strong>AI Research Paper</strong></small>
                                        <br><small class='text-muted'>15-20 pages</small>
                                    </div>
                                </div>
                            </li>
                        </ul>
                    </div>
                </div>

                <div class='card shadow-sm'>
                    <div class='card-header bg-info text-white'>
                        <h5>Study Resources</h5>
                    </div>
                    <div class='card-body'>
                        <div class='d-grid gap-2'>
                            <button class='btn btn-outline-primary btn-sm'>📖 Course Materials</button>
                            <button class='btn btn-outline-primary btn-sm'>💬 Discussion Forums</button>
                            <button class='btn btn-outline-primary btn-sm'>🎥 Recorded Lectures</button>
                            <button class='btn btn-outline-primary btn-sm'>📝 Practice Quizzes</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>";

var pdf = renderer.RenderHtmlAsPdf(bootstrapLMS);
pdf.SaveAs("lms-dashboard.pdf");
using IronPdf;

// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";

var renderer = new ChromePdfRenderer();
string bootstrapLMS = @"
<!DOCTYPE html>
<html>
<head>
    <link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css' rel='stylesheet'>
</head>
<body>
    <div class='container-fluid py-4'>
        <div class='d-flex justify-content-between align-items-center mb-4'>
            <div>
                <h1>Student Learning Dashboard</h1>
                <p class='text-muted mb-0'>Spring Semester 2025</p>
            </div>
            <span class='badge bg-success fs-5'>92% Overall Progress</span>
        </div>

        <div class='row g-4 mb-4'>
            <div class='col-md-3'>
                <div class='card text-center shadow-sm border-primary'>
                    <div class='card-body'>
                        <div class='text-primary mb-2' style='font-size: 2rem;'>📚</div>
                        <h3>6/8</h3>
                        <p class='text-muted mb-0'>Courses Completed</p>
                    </div>
                </div>
            </div>
            <div class='col-md-3'>
                <div class='card text-center shadow-sm border-success'>
                    <div class='card-body'>
                        <div class='text-success mb-2' style='font-size: 2rem;'>🎯</div>
                        <h3>24/28</h3>
                        <p class='text-muted mb-0'>Assignments Submitted</p>
                    </div>
                </div>
            </div>
            <div class='col-md-3'>
                <div class='card text-center shadow-sm border-warning'>
                    <div class='card-body'>
                        <div class='text-warning mb-2' style='font-size: 2rem;'>⏱️</div>
                        <h3>48hrs</h3>
                        <p class='text-muted mb-0'>Study Time This Week</p>
                    </div>
                </div>
            </div>
            <div class='col-md-3'>
                <div class='card text-center shadow-sm border-info'>
                    <div class='card-body'>
                        <div class='text-info mb-2' style='font-size: 2rem;'>⭐</div>
                        <h3>A- Average</h3>
                        <p class='text-muted mb-0'>Current GPA: 3.7</p>
                    </div>
                </div>
            </div>
        </div>

        <div class='row g-4'>
            <div class='col-md-8'>
                <div class='card shadow-sm'>
                    <div class='card-header bg-primary text-white'>
                        <h5>Current Courses</h5>
                    </div>
                    <div class='card-body p-0'>
                        <div class='list-group list-group-flush'>
                            <div class='list-group-item'>
                                <div class='d-flex justify-content-between align-items-center mb-2'>
                                    <div>
                                        <h6>Advanced Web Development</h6>
                                        <small class='text-muted'>Prof. Johnson | Mondays & Wednesdays, 2:00 PM</small>
                                    </div>
                                    <span class='badge bg-success'>Grade: A</span>
                                </div>
                                <div class='progress' style='height: 6px;'>
                                    <div class='progress-bar bg-success' style='width: 95%'></div>
                                </div>
                                <small class='text-muted'>95% Complete | Final Project Due: May 15</small>
                            </div>

                            <div class='list-group-item'>
                                <div class='d-flex justify-content-between align-items-center mb-2'>
                                    <div>
                                        <h6>Database Systems</h6>
                                        <small class='text-muted'>Prof. Chen | Tuesdays & Thursdays, 10:00 AM</small>
                                    </div>
                                    <span class='badge bg-primary'>Grade: A-</span>
                                </div>
                                <div class='progress' style='height: 6px;'>
                                    <div class='progress-bar bg-primary' style='width: 88%'></div>
                                </div>
                                <small class='text-muted'>88% Complete | Midterm: April 28</small>
                            </div>

                            <div class='list-group-item'>
                                <div class='d-flex justify-content-between align-items-center mb-2'>
                                    <div>
                                        <h6>Artificial Intelligence Fundamentals</h6>
                                        <small class='text-muted'>Prof. Martinez | Fridays, 1:00 PM</small>
                                    </div>
                                    <span class='badge bg-warning text-dark'>Grade: B+</span>
                                </div>
                                <div class='progress' style='height: 6px;'>
                                    <div class='progress-bar bg-warning' style='width: 75%'></div>
                                </div>
                                <small class='text-muted'>75% Complete | Research Paper Due: May 5</small>
                            </div>

                            <div class='list-group-item'>
                                <div class='d-flex justify-content-between align-items-center mb-2'>
                                    <div>
                                        <h6>Computer Networks</h6>
                                        <small class='text-muted'>Prof. Davis | Mondays & Wednesdays, 4:00 PM</small>
                                    </div>
                                    <span class='badge bg-success'>Grade: A</span>
                                </div>
                                <div class='progress' style='height: 6px;'>
                                    <div class='progress-bar bg-success' style='width: 92%'></div>
                                </div>
                                <small class='text-muted'>92% Complete | Lab Exam: April 30</small>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class='col-md-4'>
                <div class='card shadow-sm mb-3'>
                    <div class='card-header bg-warning text-dark'>
                        <h5>Upcoming Deadlines</h5>
                    </div>
                    <div class='card-body p-0'>
                        <ul class='list-group list-group-flush'>
                            <li class='list-group-item'>
                                <div class='d-flex align-items-start'>
                                    <span class='badge bg-danger me-2'>Today</span>
                                    <div class='flex-grow-1'>
                                        <small><strong>AI Assignment 4</strong></small>
                                        <br><small class='text-muted'>Neural Networks Lab</small>
                                    </div>
                                </div>
                            </li>
                            <li class='list-group-item'>
                                <div class='d-flex align-items-start'>
                                    <span class='badge bg-warning text-dark me-2'>Apr 28</span>
                                    <div class='flex-grow-1'>
                                        <small><strong>Database Midterm</strong></small>
                                        <br><small class='text-muted'>Chapters 1-8</small>
                                    </div>
                                </div>
                            </li>
                            <li class='list-group-item'>
                                <div class='d-flex align-items-start'>
                                    <span class='badge bg-info me-2'>Apr 30</span>
                                    <div class='flex-grow-1'>
                                        <small><strong>Networks Lab Exam</strong></small>
                                        <br><small class='text-muted'>Practical Assessment</small>
                                    </div>
                                </div>
                            </li>
                            <li class='list-group-item'>
                                <div class='d-flex align-items-start'>
                                    <span class='badge bg-primary me-2'>May 5</span>
                                    <div class='flex-grow-1'>
                                        <small><strong>AI Research Paper</strong></small>
                                        <br><small class='text-muted'>15-20 pages</small>
                                    </div>
                                </div>
                            </li>
                        </ul>
                    </div>
                </div>

                <div class='card shadow-sm'>
                    <div class='card-header bg-info text-white'>
                        <h5>Study Resources</h5>
                    </div>
                    <div class='card-body'>
                        <div class='d-grid gap-2'>
                            <button class='btn btn-outline-primary btn-sm'>📖 Course Materials</button>
                            <button class='btn btn-outline-primary btn-sm'>💬 Discussion Forums</button>
                            <button class='btn btn-outline-primary btn-sm'>🎥 Recorded Lectures</button>
                            <button class='btn btn-outline-primary btn-sm'>📝 Practice Quizzes</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>";

var pdf = renderer.RenderHtmlAsPdf(bootstrapLMS);
pdf.SaveAs("lms-dashboard.pdf");
$vbLabelText   $csharpLabel

Output: Professional learning management system PDF with Bootstrap 5's grid system, card components, progress bars, badges, flexbox layouts, and list groups—all rendering with perfect spacing, typography, and color accuracy.

PDFNet (Apryse): Partial Modern CSS Support

PDFNet uses a custom HTML rendering engine with selective CSS3 support:

  • Limited flexbox implementation: Bootstrap 4/5 flex-based layouts may render inconsistently
  • Partial CSS Grid support: Grid-based designs often require fallbacks
  • JavaScript constraints: Minimal execution compared to full browser environments
  • Framework testing required: Bootstrap components need validation before production use

Development impact: Teams must test each Bootstrap component individually and often create simplified layouts or alternative CSS for PDFNet, adding complexity and reducing design consistency.

For comprehensive Bootstrap framework guidance and modern CSS rendering capabilities, see the Bootstrap & Flexbox CSS Guide.

7. Printing a PDF File (Code Samples)

Printing a PDF file is a must-have feature for modern applications that deal with PDFs. Here, we will discuss how to print PDF files using both tools.

7.1. Printing a PDF file Using IronPDF

IronPDF prints a PDF by sending it to the computer's default printer. This will open the Windows print interface — just click print to make it happen.

using IronPdf;

class PrintPDF
{
    static void Main(string[] args)
    {
        // Create a new PDF and print it
        var Renderer = new IronPdf.ChromePdfRenderer();
        PdfDocument Pdf = Renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf");

        // Send the PDF to the default printer to print
        Pdf.Print(300, false);
    }
}
using IronPdf;

class PrintPDF
{
    static void Main(string[] args)
    {
        // Create a new PDF and print it
        var Renderer = new IronPdf.ChromePdfRenderer();
        PdfDocument Pdf = Renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf");

        // Send the PDF to the default printer to print
        Pdf.Print(300, false);
    }
}
$vbLabelText   $csharpLabel

7.2. Printing a PDF File Using PDFNet

PDFTron's PDFNet SDK also provides a printing feature. Below is the source code snippet for printing a PDF file in PDFNet.

using System;
using pdftron;
using pdftron.PDF;
using pdftron.Common;
using pdftron.Filters;

namespace PDFPrintTestCS
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Opening the input file...");
            using (PDFDoc pdfdoc = new PDFDoc("tiger.pdf"))
            {
                pdfdoc.InitSecurityHandler();
                Console.WriteLine("Printing the input file using PDF.Print.StartPrintJob...");
                PrinterMode printerMode = new PrinterMode();
                printerMode.SetAutoCenter(true);
                printerMode.SetAutoRotate(true);
                printerMode.SetCollation(true);
                printerMode.SetCopyCount(1);
                printerMode.SetDPI(300); // Set print quality to 300 DPI
                printerMode.SetDuplexing(PrinterMode.DuplexMode.e_Duplex_Auto);
                printerMode.SetNUp(PrinterMode.NUp.e_NUp_1_1, PrinterMode.NUpPageOrder.e_PageOrder_LeftToRightThenTopToBottom);
                printerMode.SetOrientation(PrinterMode.Orientation.e_Orientation_Portrait);
                printerMode.SetOutputAnnot(PrinterMode.PrintContentTypes.e_PrintContent_DocumentAndAnnotations);
                printerMode.SetOutputColor(PrinterMode.OutputColor.e_OutputColor_Grayscale);
                printerMode.SetOutputPageBorder(false);
                printerMode.SetOutputQuality(PrinterMode.OutputQuality.e_OutputQuality_Medium);
                printerMode.SetPaperSize(new Rect(0, 0, 612, 792));
                PageSet pagesToPrint = new PageSet(1, pdfdoc.GetPageCount(), PageSet.Filter.e_all);
                Print.StartPrintJob(pdfdoc, "", pdfdoc.GetFileName(), "", pagesToPrint, printerMode, null);
            }
        }
    }
}
using System;
using pdftron;
using pdftron.PDF;
using pdftron.Common;
using pdftron.Filters;

namespace PDFPrintTestCS
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Opening the input file...");
            using (PDFDoc pdfdoc = new PDFDoc("tiger.pdf"))
            {
                pdfdoc.InitSecurityHandler();
                Console.WriteLine("Printing the input file using PDF.Print.StartPrintJob...");
                PrinterMode printerMode = new PrinterMode();
                printerMode.SetAutoCenter(true);
                printerMode.SetAutoRotate(true);
                printerMode.SetCollation(true);
                printerMode.SetCopyCount(1);
                printerMode.SetDPI(300); // Set print quality to 300 DPI
                printerMode.SetDuplexing(PrinterMode.DuplexMode.e_Duplex_Auto);
                printerMode.SetNUp(PrinterMode.NUp.e_NUp_1_1, PrinterMode.NUpPageOrder.e_PageOrder_LeftToRightThenTopToBottom);
                printerMode.SetOrientation(PrinterMode.Orientation.e_Orientation_Portrait);
                printerMode.SetOutputAnnot(PrinterMode.PrintContentTypes.e_PrintContent_DocumentAndAnnotations);
                printerMode.SetOutputColor(PrinterMode.OutputColor.e_OutputColor_Grayscale);
                printerMode.SetOutputPageBorder(false);
                printerMode.SetOutputQuality(PrinterMode.OutputQuality.e_OutputQuality_Medium);
                printerMode.SetPaperSize(new Rect(0, 0, 612, 792));
                PageSet pagesToPrint = new PageSet(1, pdfdoc.GetPageCount(), PageSet.Filter.e_all);
                Print.StartPrintJob(pdfdoc, "", pdfdoc.GetFileName(), "", pagesToPrint, printerMode, null);
            }
        }
    }
}
$vbLabelText   $csharpLabel

8. Make PDFs from HTML

Both libraries possess HTML to PDF conversion capabilities, but the methods are slightly different.

8.1. Make PDFs from HTML Using IronPDF

IronPDF does not require the use of JSON or encryption mechanisms. IronPDF supports a wide range of methods. For example:

HTML Files to PDF

using IronPdf;

class HtmlToPdf
{
    static void Main(string[] args)
    {
        var Renderer = new IronPdf.ChromePdfRenderer();
        Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>").SaveAs("pixel-perfect.pdf");
    }
}
using IronPdf;

class HtmlToPdf
{
    static void Main(string[] args)
    {
        var Renderer = new IronPdf.ChromePdfRenderer();
        Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>").SaveAs("pixel-perfect.pdf");
    }
}
$vbLabelText   $csharpLabel

URL to PDF

using IronPdf;

class UrlToPdf
{
    static void Main(string[] args)
    {
        IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();
        var Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/");
        Pdf.SaveAs("url.pdf");
    }
}
using IronPdf;

class UrlToPdf
{
    static void Main(string[] args)
    {
        IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();
        var Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/");
        Pdf.SaveAs("url.pdf");
    }
}
$vbLabelText   $csharpLabel
A Comparison Between IronPDF and PDFNet, Figure 9

8.2. Make PDFs from HTML Using PDFNet

PDFNet also provides HTML-to-PDF conversion features using both page conversion and URL conversion. Due to the lengthy code, we will only give you one example here.

class HTML2PDFSample
{
    private static pdftron.PDFNetLoader pdfNetLoader = pdftron.PDFNetLoader.Instance();
    static HTML2PDFSample() {}

    static void Main(string[] args)
    {
        string output_path = "../../../../TestFiles/Output/html2pdf_example";
        string host = "https://www.pdftron.com";
        HTML2PDF.SetModulePath("../../../../../Lib");

        if (!HTML2PDF.IsModuleAvailable())
        {
            Console.WriteLine();
            Console.WriteLine("Unable to run HTML2PDFTest: PDFTron SDK HTML2PDF module not available.");
            return;
        }

        try
        {
            using (PDFDoc doc = new PDFDoc())
            {
                if (HTML2PDF.Convert(doc, host + "/"))
                    doc.Save(output_path + "_01.pdf", SDFDoc.SaveOptions.e_linearized);
                else
                    Console.WriteLine("Conversion failed.");
            }
        }
        catch (PDFNetException e)
        {
            Console.WriteLine(e.Message);
        }
    }
}
class HTML2PDFSample
{
    private static pdftron.PDFNetLoader pdfNetLoader = pdftron.PDFNetLoader.Instance();
    static HTML2PDFSample() {}

    static void Main(string[] args)
    {
        string output_path = "../../../../TestFiles/Output/html2pdf_example";
        string host = "https://www.pdftron.com";
        HTML2PDF.SetModulePath("../../../../../Lib");

        if (!HTML2PDF.IsModuleAvailable())
        {
            Console.WriteLine();
            Console.WriteLine("Unable to run HTML2PDFTest: PDFTron SDK HTML2PDF module not available.");
            return;
        }

        try
        {
            using (PDFDoc doc = new PDFDoc())
            {
                if (HTML2PDF.Convert(doc, host + "/"))
                    doc.Save(output_path + "_01.pdf", SDFDoc.SaveOptions.e_linearized);
                else
                    Console.WriteLine("Conversion failed.");
            }
        }
        catch (PDFNetException e)
        {
            Console.WriteLine(e.Message);
        }
    }
}
$vbLabelText   $csharpLabel
A Comparison Between IronPDF and PDFNet, Figure 10

9. Licensing

IronPDF is a library that offers a free developer license. IronPDF also offers a special price structure: the light package begins at $799 with no hidden costs. It is also possible to redistribute SaaS and OEM products. All licenses include a 30-day money-back guarantee, a year of software support and upgrades, development/testing/staging/production validity, and a perpetual license (one-time purchase). IronPDF licenses provide maximal performance for users' needs. Go to this IronPDF Licensing Page to see IronPDF's whole pricing structure and license.

A Comparison Between IronPDF and PDFNet, Figure 11

The PDFTron PDFNet SDK comes with several license choices that are tailored to your business needs. Three types of licenses come with enterprise and OEM redistributions. Enterprise licenses are only for organization use and cannot be used in app distribution. Additional APIs requiring filesystem access are also included with the licenses. All licenses come with a license key. The three types of licenses are:

  • Viewer
  • Viewer & Annotation
  • Core SDK

For further information on their license structures, visit this PDFTron Licensing Information Page.

10. Conclusion

IronPDF offers a lot of features and functionality for processing PDF files and converting them to different formats. Conversions from HTML to PDF are produced in a vector format that is appropriate for high-quality commercial printing. As a result, you'll receive a clear, high-quality PDF. License and pricing information can be found on the website.

Similar to IronPDF, PDFNet aids with the transition, annotation, signature, filling, conversion, and editing of PDF files. It supports multiple platforms, including Windows, iOS, Android, WEB, and Linux. For production use, PDFNet SDKs need a product key.

IronPDF's licenses are developer-centric, meaning that you have to get a license based on how many developers are going to use the product. On the other hand, PDFNet licenses don't work in the same manner, operating instead on a feature-based license. This means that you have to get the license that supports the features that are required. IronPDF licenses include all features out of the box. With PDFNet, some features, such as document conversion, need to be bought as add-ons.

The IronPDF library offers features in an organized manner, making it easy to write code that performs big tasks using a few lines of code. Iron Software is currently offering a five-tool package for the price of just two. The tools included in the Iron Suite are:

Please visit this Iron Suite Information Page to Explore Iron Suite.

참고해 주세요PDFTron is a registered trademark of its respective owner. This site is not affiliated with, endorsed by, or sponsored by PDFTron. All product names, logos, and brands are property of their respective owners. Comparisons are for informational purposes only and reflect publicly available information at the time of writing.

자주 묻는 질문

이 문서에서 비교되는 주요 PDF 라이브러리는 무엇인가요?

이 문서에서는 Iron Software에서 개발한 IronPDF와 PDFTron의 PDFNet을 비교하여 .NET 프레임워크 내 C# 개발자를 위한 기능에 중점을 두고 설명합니다.

C#에서 HTML을 PDF로 변환하려면 어떻게 해야 하나요?

IronPDF의 RenderHtmlAsPdf 메서드를 사용하여 HTML 문자열을 PDF로 변환할 수 있습니다. 또한 IronPDF의 강력한 Chromium 엔진을 사용하여 HTML 파일과 URL을 PDF로 변환할 수 있습니다.

IronPDF는 어떤 운영 체제를 지원하나요?

IronPDF는 Windows, Azure, Docker를 비롯한 여러 운영 체제를 지원하므로 다양한 개발 환경에 원활하게 통합할 수 있습니다.

IronPDF는 PDF 데이터 추출을 어떻게 처리하나요?

IronPDF를 사용하면 효율적인 PDF 데이터 추출이 가능하므로 개발자는 PDF 문서에서 텍스트와 이미지를 쉽게 검색하여 추가 처리를 할 수 있습니다.

IronPDF의 설치 옵션은 무엇인가요?

IronPDF는 Visual Studio NuGet 패키지 관리자, Visual Studio 명령줄 또는 NuGet 갤러리에서 직접 설치할 수 있으므로 개발자가 쉽게 설정할 수 있습니다.

IronPDF와 PDFNet의 라이선스 차이점은 무엇인가요?

IronPDF는 모든 기능이 포함된 개발자 중심 라이선스를 제공하는 반면, PDFNet 라이선스는 기능 기반이며 특정 기능에 대해서는 추가 구매가 필요할 수 있습니다.

IronPDF는 대용량 PDF 작업에 적합하나요?

예, IronPDF는 사용이 간편하고 코드 요구 사항이 최소화되어 대용량 PDF 작업을 효율적으로 처리하는 데 적합하다는 평가를 받고 있습니다.

Iron 소프트웨어 제품군에는 어떤 추가 도구가 포함되어 있나요?

Iron 소프트웨어 제품군에는 IronBarcode, IronXL, IronOCR, IronPDF 및 IronWebscraper가 포함되어 있으며, 패키지 상품으로 제공되므로 개발자에게 더욱 매력적으로 다가갈 수 있습니다.

커티스 차우
기술 문서 작성자

커티스 차우는 칼턴 대학교에서 컴퓨터 과학 학사 학위를 취득했으며, Node.js, TypeScript, JavaScript, React를 전문으로 하는 프론트엔드 개발자입니다. 직관적이고 미적으로 뛰어난 사용자 인터페이스를 만드는 데 열정을 가진 그는 최신 프레임워크를 활용하고, 잘 구성되고 시각적으로 매력적인 매뉴얼을 제작하는 것을 즐깁니다.

커티스는 개발 분야 외에도 사물 인터넷(IoT)에 깊은 관심을 가지고 있으며, 하드웨어와 소프트웨어를 통합하는 혁신적인 방법을 연구합니다. 여가 시간에는 게임을 즐기거나 디스코드 봇을 만들면서 기술에 대한 애정과 창의성을 결합합니다.