Porównanie IronPDF i PDFNet
1. Wprowadzenie
Szukasz idealnych narzędzi do obsługi plików PDF dla platformy .NET Framework?
W tym artykule przyjrzymy się, jak pracować z plikami PDF w języku C# (jednym z najpopularniejszych języków programowania). Omówimy dwa wiodące w branży narzędzia do obsługi plików PDF dla języka C# w środowisku .NET Framework, wykorzystując przykłady kodu do porównania ich pod kątem wydajności i funkcji. Na koniec przyjrzymy się szczegółom licencji i dowiemy się, jak uzyskać klucze licencyjne.
Dwie biblioteki PDF to:
- PDFNet
- IronPDF
2. IronPDF
IronPDF to biblioteka C# .NET opracowana przez Iron Software w celu rozwiązania wszystkich problemów związanych z plikami PDF dla programistów C# .NET przy użyciu jednej biblioteki. IronPDF jest oparty na silniku Chromium i oferuje szereg przydatnych i zaawansowanych funkcji, takich jak konwersja plików HTML5, JavaScript, CSS i obrazów do formatu PDF, tworzenie niestandardowych nagłówków i stopek oraz wyświetlanie plików PDF dokładnie tak, jak wyglądają w przeglądarce. IronPDF umożliwia odczytywanie danych z plików PDF i automatyczne wstawianie ich do aplikacji .NET oraz systemów przechowywania danych. Możesz importować, przenosić i indeksować treści ze starego magazynu dokumentów PDF do swoich aplikacji do zarządzania dokumentami i aplikacji biznesowych.
2.1. Funkcje IronPDF
2.1.1. PDF Conversions
Ta funkcja pozwala generować pliki PDF z różnych formatów, takich jak HTML, widoki MVC, formularze internetowe, ciągi znaków HTML i adresy URL.
2.1.2. Pobieranie treści z plików PDF
W wielu przypadkach można łatwo wyodrębnić tekst osadzony w plikach PDF. Jeśli jednak to nie zadziała, najprawdopodobniej tekst jest osadzony w obrazie. Aby skanować dokumenty w poszukiwaniu tekstu wizualnego, a nie zwykłego tekstu, należy użyć biblioteki IronOCR.
2.1.3 Nagłówki i stopki
Nagłówki i stopki można dodawać podczas tworzenia plików PDF lub do istniejących plików PDF. Za pomocą właściwości Opcje drukowania można utworzyć nagłówek i stopkę dla każdej strony dokumentu. Te parametry są dostępne w obiekcie ChromePdfRenderer. Ten przykład działa w aplikacji konsolowej .NET Core.
2.1.4. Przetwarzanie obrazów w formacie PDF
Umożliwia to użytkownikom generowanie obrazów z plików PDF, a także plików PDF ze zdjęć. Obsługuje wyodrębnianie obrazów, różne rozszerzenia obrazów oraz drukowanie plików PDF.
2.1.5. Dokumenty PDF IO
IronPDF oferuje również 128-bitowe szyfrowanie plików PDF, blokowanie plików PDF za pomocą hasła oraz podpisywanie cyfrowym podpisem.
2.1.6. Edycja plików PDF
Narzędzie IronPDF pozwala dodawać do plików PDF znaki wodne, dodawać i usuwać strony, tła, elementy pierwszego planu i wiele więcej.
2.1.7. Compatibility
IronPDF obsługuje prawie wszystkie systemy operacyjne i frameworki kompatybilne z C#, takie jak:
- 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 firmy PDFTron zapewnia precyzyjne przetwarzanie, adnotowanie, edycję i tworzenie plików PDF w dowolnym środowisku lub aplikacji w sieci, na urządzeniach mobilnych, komputerach stacjonarnych lub serwerach. Zarządza całym procesem zarządzania dokumentami i informacjami w ramach Twojej infrastruktury i eliminuje konieczność korzystania z serwerów stron trzecich. Platforma internetowa PDFTron zawiera wersję JS z obsługiwanymi platformami oraz klucz licencyjny do wersji demonstracyjnej wszystkich zestawów SDK do obsługi plików PDF.
Jedną z najważniejszych zalet PDFNet jest to, że jest to rozwiązanie prawdziwie wieloplatformowe, pozwalające naszym użytkownikom w prosty sposób dodać obsługę plików PDF i odpowiednie funkcje biznesowe do swoich procesów i aplikacji w wielu różnych środowiskach mobilnych i stacjonarnych, a wszystko to przy użyciu praktycznie tego samego interfejsu.
3.1. Funkcje PDFNet SDK
3.1.1. Kompatybilność
Pakiet PDFNet SDK jest kompatybilny z wieloma platformami i frameworkami. Aby zapewnić spójność platformy, interfejs API JavaScript jest wykorzystywany w taki sam sposób jak interfejs API PDFNet. Dostępne są również wersje SDK dla Node.js i Electron. Ten pakiet wymaga niezarządzanych plików binarnych dodatków.
3.1.2. Edycja i przeglądanie
Zapewnia użytkownikom korzystającym z platform internetowych, mobilnych i stacjonarnych bezpieczne, skalowalne i wysokiej jakości możliwości czytania i edycji plików PDF.
3.1.3. Podpisywanie
Stwórz spersonalizowane procedury podpisywania. Dokumenty podpisane cyfrowo mogą być certyfikowane, weryfikowane i pieczętowane.
3.1.4. Prawdziwa redakcja
Należy usunąć z dokumentów dane wrażliwe, takie jak dane osobowe lub informacje dotyczące zdrowia, zachowując jednocześnie możliwość przeszukiwania dokumentu.
3.1.5. Manipulowanie stroną
Strony mogą być dodawane, usuwane lub zmieniane. Dokumenty mogą być łączone, scalane lub dzielone na części. Wyświetlaj kilka dokumentów jednocześnie w tym samym czytniku lub obok siebie.
4. Creating a New Project in Visual Studio
W tym artykule wykorzystamy aplikację konsolową do generowania dokumentów PDF.
Open the Visual Studio software and go to the File menu. Select "new project" and then select console application.
Wpisz nazwę projektu i wybierz ścieżkę w odpowiednim polu tekstowym. Then, click the create button. Select the required .NET framework, as in the screenshot below:
Projekt Visual Studio wygeneruje teraz strukturę aplikacji konsolowej. Once finished, it will open the Program.cs file, in which you can write and execute source code.
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. Są to:
- Korzystanie z menedżera pakietów NuGet w Visual Studio
- Korzystanie z wiersza poleceń programu Visual Studio.
- Bezpośrednie pobranie z pakietu IronPDF w galerii NuGet.
- Bezpośrednie pobranie ze strony pobierania IronPDF.
5.1 Using the Visual Studio NuGet Package Manager
Oprogramowanie Visual Studio udostępnia opcję NuGet Package Manager, która pozwala zainstalować pakiet bezpośrednio w rozwiązaniu. Poniższy zrzut ekranu pokazuje, jak otworzyć menedżera pakietów NuGet.
Po otwarciu interfejsu graficznego menedżera pakietów kliknij kartę Przeglądaj i wyszukaj "IronPDF:".
In the above image, we can see the list of related packages from the search. Wybierz opcję IronPDF i zainstaluj pakiet w naszym rozwiązaniu.
5.2 Using the Visual Studio Command-Line
- W menu Visual Studio przejdź do Narzędzia > Menedżer pakietów NuGet > Konsola menedżera pakietów
- Enter the following line in the package manager console tab:
Install-Package IronPdf
Pakiet IronPDF zostanie teraz zainstalowany w projekcie.
5.3 Direct Download from the NuGet Webpage
Trzecim sposobem jest pobranie pakietu NuGet bezpośrednio z galerii NuGet IronPDF Package.
- Wybierz opcję pakietu do pobrania z menu po prawej stronie.
- Double-click the downloaded package; it will be installed automatically.
- Następnie przeładuj rozwiązanie i zacznij z niego korzystać w projekcie.
5.4 Direct Download from the IronPDF Webpage
Pobierz najnowszy pakiet bezpośrednio ze strony pobierania IronPDF. After the download, follow the steps below to add the package to the project.
- Kliknij prawym przyciskiem myszy projekt w oknie rozwiązania.
- Następnie wybierz opcję "Odwołania" i przejdź do lokalizacji pobranego odwołania.
- Następnie kliknij OK, aby dodać odwołanie.
6. Zainstaluj pakiet PDFNet SDK
Pakiet PDFNet SDK można pobrać i zainstalować na cztery różne sposoby.
- Korzystanie z menedżera pakietów NuGet w Visual Studio.
- Korzystanie z wiersza poleceń programu Visual Studio.
- Bezpośrednie pobranie z pakietu PDFNet w galerii NuGet.
- Korzystanie z biblioteki PDFNetLoader.dll
6.1. Using the Visual Studio NuGet Package Manager
Jak wyjaśniono powyżej, przejdź do narzędzi w Visual Studio i otwórz menedżera pakietów NuGet. Pojawi się lista — kliknij opcję zarządzania pakietem NuGet, aby uzyskać rozwiązania.
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
- W menu Visual Studio przejdź do Narzędzia > Menedżer pakietów NuGet > Konsola menedżera pakietów
- Enter the following line in the package manager console tab:
Install-Package PDFNet -Version 9.2.0
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 class='display-6 mb-1'>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 class='mb-1'>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 class='mb-1'>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 class='mb-1'>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 class='mb-1'>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 class='mb-0'>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 class='mb-1'>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 class='mb-1'>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 class='mb-1'>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 class='mb-1'>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 class='mb-0'>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 class='mb-0'>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 class='display-6 mb-1'>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 class='mb-1'>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 class='mb-1'>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 class='mb-1'>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 class='mb-1'>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 class='mb-0'>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 class='mb-1'>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 class='mb-1'>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 class='mb-1'>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 class='mb-1'>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 class='mb-0'>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 class='mb-0'>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");
Imports IronPdf
' Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here"
Dim renderer As New ChromePdfRenderer()
Dim bootstrapLMS As String = "
<!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 class='display-6 mb-1'>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 class='mb-1'>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 class='mb-1'>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 class='mb-1'>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 class='mb-1'>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 class='mb-0'>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 class='mb-1'>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 class='mb-1'>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 class='mb-1'>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 class='mb-1'>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 class='mb-0'>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 class='mb-0'>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>"
Dim pdf = renderer.RenderHtmlAsPdf(bootstrapLMS)
pdf.SaveAs("lms-dashboard.pdf")
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);
}
}
Imports IronPdf
Friend Class PrintPDF
Shared Sub Main(ByVal args() As String)
' Create a new PDF and print it
Dim Renderer = New IronPdf.ChromePdfRenderer()
Dim Pdf As PdfDocument = Renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf")
' Send the PDF to the default printer to print
Pdf.Print(300, False)
End Sub
End Class
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);
}
}
}
}
Imports System
Imports pdftron
Imports pdftron.PDF
Imports pdftron.Common
Imports pdftron.Filters
Namespace PDFPrintTestCS
Friend Class Program
Shared Sub Main(ByVal args() As String)
Console.WriteLine("Opening the input file...")
Using pdfdoc As New PDFDoc("tiger.pdf")
pdfdoc.InitSecurityHandler()
Console.WriteLine("Printing the input file using PDF.Print.StartPrintJob...")
Dim printerMode As 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))
Dim pagesToPrint As New PageSet(1, pdfdoc.GetPageCount(), PageSet.Filter.e_all)
Print.StartPrintJob(pdfdoc, "", pdfdoc.GetFileName(), "", pagesToPrint, printerMode, Nothing)
End Using
End Sub
End Class
End Namespace
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. Na przykład:
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");
}
}
Imports IronPdf
Friend Class HtmlToPdf
Shared Sub Main(ByVal args() As String)
Dim Renderer = New IronPdf.ChromePdfRenderer()
Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>").SaveAs("pixel-perfect.pdf")
End Sub
End Class
URL do pliku 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");
}
}
Imports IronPdf
Friend Class UrlToPdf
Shared Sub Main(ByVal args() As String)
Dim Renderer As New IronPdf.ChromePdfRenderer()
Dim Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/")
Pdf.SaveAs("url.pdf")
End Sub
End Class
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);
}
}
}
Friend Class HTML2PDFSample
Private Shared pdfNetLoader As pdftron.PDFNetLoader = pdftron.PDFNetLoader.Instance()
Shared Sub New()
End Sub
Shared Sub Main(ByVal args() As String)
Dim output_path As String = "../../../../TestFiles/Output/html2pdf_example"
Dim host As String = "https://www.pdftron.com"
HTML2PDF.SetModulePath("../../../../../Lib")
If Not HTML2PDF.IsModuleAvailable() Then
Console.WriteLine()
Console.WriteLine("Unable to run HTML2PDFTest: PDFTron SDK HTML2PDF module not available.")
Return
End If
Try
Using doc As New PDFDoc()
If HTML2PDF.Convert(doc, host & "/") Then
doc.Save(output_path & "_01.pdf", SDFDoc.SaveOptions.e_linearized)
Else
Console.WriteLine("Conversion failed.")
End If
End Using
Catch e As PDFNetException
Console.WriteLine(e.Message)
End Try
End Sub
End Class
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.
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.
Często Zadawane Pytania
Jakie są kluczowe biblioteki PDF porównywane w artykule?
Artykuł porównuje IronPDF, opracowany przez Iron Software, oraz PDFNet firmy PDFTron, skupiając się na ich możliwościach dla programistów C# w ramach .NET Framework.
Jak mogę przekonwertować HTML na PDF w języku C#?
Możesz użyć metody RenderHtmlAsPdf biblioteki IronPDF do konwersji ciągów HTML na pliki PDF. Dodatkowo możesz konwertować pliki HTML i adresy URL na pliki PDF przy użyciu solidnego silnika Chromium biblioteki IronPDF.
Jakie systemy operacyjne są obsługiwane przez IronPDF?
IronPDF obsługuje wiele systemów operacyjnych, w tym Windows, Azure i Docker, co pozwala na płynną integrację z różnorodnymi środowiskami programistycznymi.
W jaki sposób IronPDF radzi sobie z ekstrakcją danych z plików PDF?
IronPDF umożliwia wydajne wyodrębnianie danych z plików PDF, pozwalając programistom na łatwe pobieranie tekstu i obrazów z dokumentów PDF w celu dalszego przetwarzania.
Jakie są opcje instalacji IronPDF?
IronPDF można zainstalować za pomocą menedżera pakietów NuGet w Visual Studio, wiersza poleceń Visual Studio lub bezpośrednio z galerii NuGet, co zapewnia programistom łatwą konfigurację.
Jakie są różnice w licencjonowaniu między IronPDF a PDFNet?
IronPDF oferuje licencje przeznaczone dla programistów, które obejmują wszystkie funkcje, natomiast licencje PDFNet są oparte na funkcjach i mogą wymagać dodatkowych zakupów w celu uzyskania określonych funkcji.
Czy IronPDF nadaje się do dużych zadań związanych z plikami PDF?
Tak, IronPDF jest chwalony za łatwość obsługi i minimalne wymagania dotyczące kodu, dzięki czemu nadaje się do wydajnego wykonywania dużych zadań związanych z plikami PDF.
Jakie dodatkowe narzędzia są zawarte w Suite Iron Software?
Pakiet Iron Software obejmuje IronBarcode, IronXL, IronOCR, IronPDF i IronWebscraper, dostępne w pakiecie, co zwiększa jego atrakcyjność dla programistów.



