Porównanie IronPDF i Winnovative PDF Library dla .NET
Adobe designed the Portable Document Format (PDF) to provide text and graphic formatting for documents. A second application is required to open PDF files. PDF files have become increasingly relevant in today's culture. Portable Document Format files are utilized in a range of businesses for invoicing and document production. Developers use the PDF format to help fulfill their clients' needs when creating documents. Creating PDFs has never been easier thanks to the libraries available today. In order to identify which library is the best on the market to employ in a project, we must consider elements such as constructing, reading, and converting.
In this article, we will compare the two most popular PDF converter libraries for .NET components; these two libraries are:
- IronPDF
- Winnovative
IronPDF and Winnovative are two libraries that may be used in your .NET applications to create, read, and update PDF files, whether on an online or desktop application. These two libraries can now be compared to see which is the best fit for our application. We will examine the features of the two libraries first, then compare their performance levels in converting and handling PDF files. Both libraries are supported by .NET frameworks.
Funkcje IronPDF
IronPDF is a powerful PDF converter that can handle almost any task that a browser can handle. The .NET library for developers makes it easy to create, read, and manipulate PDF files. IronPDF uses the Chrome engine to convert HTML to PDF files. Among other web components, IronPDF supports HTML, ASPX, Razor HTML, and MVC View. IronPDF supports both ASP.NET Web applications and traditional Windows applications. IronPDF can also be used to make attractive PDF documents.
IronPDF allows us to create PDF files from HTML5, JavaScript, CSS, and pictures. In addition, headers and footers can be included in the files. We can read PDF files with ease thanks to IronPDF. IronPDF also includes a powerful HTML-to-PDF converter that can handle PDF files, as well as a robust PDF converting engine.
- HTML, HTML5, ASPX, and Razor/MVC View are all examples of sources that can be used to create PDF files. Not only may HTML files be converted to PDF, but we can also convert image files to PDF.
- IronPDF can help you create interactive PDF documents, fill out and submit interactive forms, merge and split PDF documents, extract text and images from PDF documents, search text in PDF documents, rasterize PDF pages to images, convert PDF to HTML, and print PDF documents.
- IronPDF can generate a document from a URL. For login behind HTML login forms, it also allows the use of custom network login credentials, user agents, proxies, cookies, HTTP headers, and form variables.
- IronPDF is an application that allows you to read and fill in PDF documents.
- IronPDF is capable of extracting images from documents.
- IronPDF allows us to add headers, footers, text, photos, bookmarks, watermarks, and more to documents.
- IronPDF enables us to join and split pages in a new or existing document.
- We can convert documents to PDF objects without using an Acrobat viewer.
- It is possible to convert a CSS file to a PDF document.
- CSS file media-type files can be converted into documents.
Winnovative Features
The Winnovative HTML-to-PDF Converter Library for .NET and .NET Core can be used to convert URLs, HTML strings, and streams to a PDF document, a raster image, or an SVG vector image in any .NET and .NET Core application, including ASP.NET, ASP.NET Core, and MVC websites, Windows Forms and WPF applications, and Azure Cloud Services.
You can use the HTML-to-PDF Converter for .NET as a general-purpose tool for converting web pages and HTML code to PDF and images, or you can use it as part of our .NET Reporting Toolkit to quickly create PDF reports directly from ASP.NET pages, and take advantage of ASP.NET controls' incredible capability.
HTML tags, HTML5 with CSS3, SVG and Web Fonts, page breaks, media type rules, repeating HTML tables, headers and footers, hierarchical bookmarks, tables of contents, fillable PDF forms, and HTML with page numbering in headers and footers are all supported by the converter.
The HTML-to-PDF Converter does not rely on any third-party software, and no special server settings are required for it to function. The same assembly works in both 32-bit and 64-bit environments, and copy server deployment is possible. The library works with the frameworks .NET 2.0, .NET 4.0, and later, as well as the runtimes .NET Core 2.1, .NET Core 3.0, and later.
- Convert web pages, HTML strings, or in-memory PDF files.
- Convert HTML strings and web pages to raster image formats.
- CSS3, SVG, and Web Fonts-all supported HTML5 capabilities.
- Convert HTML to PDF with SVG and Web Fonts.
- During the conversion, you can enable or disable JavaScript.
- Consolidate numerous PDF files into a single PDF.
- Split a PDF file into numerous PDF files.
- Fill out PDF forms and save the completed document as a PDF.
- Edit existing PDF documents.
- Add image elements to the PDF document that has been prepared.
Zgodność z Bootstrapem i nowoczesnymi frameworkami CSS
Modern web applications increasingly rely on CSS frameworks like Bootstrap, Tailwind, and Foundation for rapid UI development. When generating PDFs from these applications, maintaining layout fidelity is crucial for professional document quality.
IronPDF: Native Bootstrap 5 Support
IronPDF's Chromium-based rendering engine delivers full support for modern CSS frameworks without configuration:
- Bootstrap 5: Complete flexbox and CSS Grid support for all components
- Bootstrap 4: Pełna kompatybilność z zestawami kart, paskami nawigacyjnymi i responsywnymi narzędziami
- Tailwind CSS: Wszystkie klasy użytkowe i modyfikatory responsywności renderują się poprawnie
- Funkcje CSS3: Flexbox, Grid, transformacje, animacje i właściwości niestandardowe
- Web Fonts: Google Fonts, Font Awesome, and custom
@font-facedeclarations
Sprawdzone na prawdziwych przykładach: strona główna Bootstrap oraz oficjalne szablony Bootstrap konwertują się do formatu PDF z idealną dokładnością co do piksela.
Przykład kodu: Układ biuletynu w wielu kolumnach
using IronPdf;
var renderer = new ChromePdfRenderer();
string bootstrapNewsletter = @"
<!DOCTYPE html>
<html>
<head>
<link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css' rel='stylesheet'>
<style>
.article-image { width: 100%; height: 200px; object-fit: cover; }
</style>
</head>
<body>
<div class='container my-5'>
<div class='text-center mb-5'>
<h1 class='display-4'>Monthly Tech Newsletter</h1>
<p class='lead text-muted'>March 2025 Edition</p>
</div>
<div class='row g-4'>
<div class='col-md-8'>
<article class='card shadow-sm mb-4'>
<img src='https://via.placeholder.com/800x300' class='card-img-top article-image' alt='Featured'>
<div class='card-body'>
<span class='badge bg-primary mb-2'>Featured Article</span>
<h2 class='card-title'>The Future of Cloud Computing</h2>
<p class='card-text'>Explore the latest trends in cloud architecture and serverless computing that are reshaping how we build applications...</p>
<div class='d-flex justify-content-between align-items-center'>
<small class='text-muted'>By Sarah Johnson</small>
<small class='text-muted'>March 15, 2025</small>
</div>
</div>
</article>
<div class='row row-cols-1 row-cols-md-2 g-4'>
<div class='col'>
<div class='card h-100'>
<img src='https://via.placeholder.com/400x200' class='card-img-top' alt='Article 2'>
<div class='card-body'>
<h5 class='card-title'>AI in Development</h5>
<p class='card-text'>How artificial intelligence is transforming software development workflows.</p>
</div>
</div>
</div>
<div class='col'>
<div class='card h-100'>
<img src='https://via.placeholder.com/400x200' class='card-img-top' alt='Article 3'>
<div class='card-body'>
<h5 class='card-title'>Security Best Practices</h5>
<p class='card-text'>Essential security measures every developer should implement in 2025.</p>
</div>
</div>
</div>
</div>
</div>
<div class='col-md-4'>
<div class='card bg-light mb-4'>
<div class='card-body'>
<h5 class='card-title'>Quick Links</h5>
<ul class='list-unstyled'>
<li class='mb-2'><a href='#' class='text-decoration-none'>API Documentation</a></li>
<li class='mb-2'><a href='#' class='text-decoration-none'>Tutorial Videos</a></li>
<li class='mb-2'><a href='#' class='text-decoration-none'>Community Forum</a></li>
<li class='mb-2'><a href='#' class='text-decoration-none'>GitHub Repository</a></li>
</ul>
</div>
</div>
<div class='card border-primary'>
<div class='card-body'>
<h5 class='card-title text-primary'>Subscribe</h5>
<p class='card-text'>Get the latest updates delivered to your inbox.</p>
<form>
<input type='email' class='form-control mb-2' placeholder='your@email.com'>
<button class='btn btn-primary w-100'>Subscribe Now</button>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
</html>";
var pdf = renderer.RenderHtmlAsPdf(bootstrapNewsletter);
pdf.SaveAs("newsletter.pdf");
using IronPdf;
var renderer = new ChromePdfRenderer();
string bootstrapNewsletter = @"
<!DOCTYPE html>
<html>
<head>
<link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css' rel='stylesheet'>
<style>
.article-image { width: 100%; height: 200px; object-fit: cover; }
</style>
</head>
<body>
<div class='container my-5'>
<div class='text-center mb-5'>
<h1 class='display-4'>Monthly Tech Newsletter</h1>
<p class='lead text-muted'>March 2025 Edition</p>
</div>
<div class='row g-4'>
<div class='col-md-8'>
<article class='card shadow-sm mb-4'>
<img src='https://via.placeholder.com/800x300' class='card-img-top article-image' alt='Featured'>
<div class='card-body'>
<span class='badge bg-primary mb-2'>Featured Article</span>
<h2 class='card-title'>The Future of Cloud Computing</h2>
<p class='card-text'>Explore the latest trends in cloud architecture and serverless computing that are reshaping how we build applications...</p>
<div class='d-flex justify-content-between align-items-center'>
<small class='text-muted'>By Sarah Johnson</small>
<small class='text-muted'>March 15, 2025</small>
</div>
</div>
</article>
<div class='row row-cols-1 row-cols-md-2 g-4'>
<div class='col'>
<div class='card h-100'>
<img src='https://via.placeholder.com/400x200' class='card-img-top' alt='Article 2'>
<div class='card-body'>
<h5 class='card-title'>AI in Development</h5>
<p class='card-text'>How artificial intelligence is transforming software development workflows.</p>
</div>
</div>
</div>
<div class='col'>
<div class='card h-100'>
<img src='https://via.placeholder.com/400x200' class='card-img-top' alt='Article 3'>
<div class='card-body'>
<h5 class='card-title'>Security Best Practices</h5>
<p class='card-text'>Essential security measures every developer should implement in 2025.</p>
</div>
</div>
</div>
</div>
</div>
<div class='col-md-4'>
<div class='card bg-light mb-4'>
<div class='card-body'>
<h5 class='card-title'>Quick Links</h5>
<ul class='list-unstyled'>
<li class='mb-2'><a href='#' class='text-decoration-none'>API Documentation</a></li>
<li class='mb-2'><a href='#' class='text-decoration-none'>Tutorial Videos</a></li>
<li class='mb-2'><a href='#' class='text-decoration-none'>Community Forum</a></li>
<li class='mb-2'><a href='#' class='text-decoration-none'>GitHub Repository</a></li>
</ul>
</div>
</div>
<div class='card border-primary'>
<div class='card-body'>
<h5 class='card-title text-primary'>Subscribe</h5>
<p class='card-text'>Get the latest updates delivered to your inbox.</p>
<form>
<input type='email' class='form-control mb-2' placeholder='your@email.com'>
<button class='btn btn-primary w-100'>Subscribe Now</button>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
</html>";
var pdf = renderer.RenderHtmlAsPdf(bootstrapNewsletter);
pdf.SaveAs("newsletter.pdf");
Imports IronPdf
Dim renderer As New ChromePdfRenderer()
Dim bootstrapNewsletter As String = "
<!DOCTYPE html>
<html>
<head>
<link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css' rel='stylesheet'>
<style>
.article-image { width: 100%; height: 200px; object-fit: cover; }
</style>
</head>
<body>
<div class='container my-5'>
<div class='text-center mb-5'>
<h1 class='display-4'>Monthly Tech Newsletter</h1>
<p class='lead text-muted'>March 2025 Edition</p>
</div>
<div class='row g-4'>
<div class='col-md-8'>
<article class='card shadow-sm mb-4'>
<img src='https://via.placeholder.com/800x300' class='card-img-top article-image' alt='Featured'>
<div class='card-body'>
<span class='badge bg-primary mb-2'>Featured Article</span>
<h2 class='card-title'>The Future of Cloud Computing</h2>
<p class='card-text'>Explore the latest trends in cloud architecture and serverless computing that are reshaping how we build applications...</p>
<div class='d-flex justify-content-between align-items-center'>
<small class='text-muted'>By Sarah Johnson</small>
<small class='text-muted'>March 15, 2025</small>
</div>
</div>
</article>
<div class='row row-cols-1 row-cols-md-2 g-4'>
<div class='col'>
<div class='card h-100'>
<img src='https://via.placeholder.com/400x200' class='card-img-top' alt='Article 2'>
<div class='card-body'>
<h5 class='card-title'>AI in Development</h5>
<p class='card-text'>How artificial intelligence is transforming software development workflows.</p>
</div>
</div>
</div>
<div class='col'>
<div class='card h-100'>
<img src='https://via.placeholder.com/400x200' class='card-img-top' alt='Article 3'>
<div class='card-body'>
<h5 class='card-title'>Security Best Practices</h5>
<p class='card-text'>Essential security measures every developer should implement in 2025.</p>
</div>
</div>
</div>
</div>
</div>
<div class='col-md-4'>
<div class='card bg-light mb-4'>
<div class='card-body'>
<h5 class='card-title'>Quick Links</h5>
<ul class='list-unstyled'>
<li class='mb-2'><a href='#' class='text-decoration-none'>API Documentation</a></li>
<li class='mb-2'><a href='#' class='text-decoration-none'>Tutorial Videos</a></li>
<li class='mb-2'><a href='#' class='text-decoration-none'>Community Forum</a></li>
<li class='mb-2'><a href='#' class='text-decoration-none'>GitHub Repository</a></li>
</ul>
</div>
</div>
<div class='card border-primary'>
<div class='card-body'>
<h5 class='card-title text-primary'>Subscribe</h5>
<p class='card-text'>Get the latest updates delivered to your inbox.</p>
<form>
<input type='email' class='form-control mb-2' placeholder='your@email.com'>
<button class='btn btn-primary w-100'>Subscribe Now</button>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
</html>"
Dim pdf = renderer.RenderHtmlAsPdf(bootstrapNewsletter)
pdf.SaveAs("newsletter.pdf")
Wynik: profesjonalny układ biuletynu z responsywną siatką Bootstrap, komponentami kartowymi i narzędziami flexbox — wszystko dokładnie zachowane w dokumencie PDF.
Winnovative: Częściowa obsługa Bootstrap z ograniczeniami
Konwerter HTML na PDF firmy Winnovative wykorzystuje niestandardowy silnik renderujący oparty na WebKit, który ma określone ograniczenia dotyczące nowoczesnych frameworków CSS:
- HTML5 i CSS3: Ogłaszana obsługa, ale istnieją luki w implementacji zaawansowanych funkcji
- Obsługa Flexbox: Częściowa implementacja, złożone układy Bootstrap 4/5 mogą nie wyświetlać się poprawnie
- CSS Grid: Ograniczona obsługa lub brak obsługi specyfikacji układu CSS Grid
- Bootstrap 3: Ogólnie dobrze współpracuje z układami opartymi na tabelach
- Bootstrap 4/5: Komponenty intensywnie wykorzystujące Flexbox wymagają testowania i potencjalnych rozwiązań zastępczych
Zgodnie z opiniami programistów, użytkownicy Winnovative często napotykają:
- Renderowanie pasków nawigacyjnych Bootstrap z problemami z układem
- Elementy kart z flexboxem nie wyrównują się poprawnie
- Punkty przełamania siatki responsywnej nie są uwzględniane w pliku PDF
- Konieczność zastosowania niestandardowych rozwiązań CSS w celu uzyskania prawidłowego renderowania Bootstrap
Wpływ na rozwój: Aplikacje zbudowane przy użyciu Bootstrap 4+ mogą wymagać znacznych modyfikacji CSS lub powrotu do układów opartych na tabelach, aby zapewnić niezawodne generowanie plików PDF za pomocą Winnovative, co zwiększa koszty rozwoju i utrzymania.
For comprehensive Bootstrap compatibility guidance, see the Bootstrap & Flexbox CSS Guide.
Tworzenie nowego projektu w Visual Studio
Open the Visual Studio software and go to the File menu. Wybierz "nowy projekt", a następnie "aplikacja konsolowa". W tym artykule wykorzystamy aplikację konsolową do generowania dokumentów PDF.
Wpisz nazwę projektu i wybierz ścieżkę do pliku w odpowiednim polu tekstowym. Następnie kliknij przycisk Utwórz i wybierz wymagany .NET Framework, tak jak na poniższym zrzucie ekranu.
The Visual Studio project will now generate the structure for the selected application, and if you have selected the console, Windows, and web application, it will open the Program.cs file where you can enter the code and build/run the application.
Następnie możemy dodać bibliotekę, aby przetestować kod.
Install the IronPDF Library
Bibliotekę IronPDF można pobrać i zainstalować na cztery sposoby.
Są to:
- Korzystanie z programu Visual Studio.
- Using the Visual Studio Command-Line.
- Direct download from the NuGet website.
- Direct download from the IronPDF website.
Korzystanie z programu Visual Studio
The Visual Studio software provides the NuGet Package manager option to install the package directly to the solution. Poniższy zrzut ekranu pokazuje, jak otworzyć menedżera pakietów NuGet.
Udostępnia pole wyszukiwania, w którym wyświetlana jest lista pakietów ze strony NuGet. W menedżerze pakietów należy wyszukać słowo kluczowe "IronPDF", tak jak na poniższym zrzucie ekranu.
Na powyższym obrazku widzimy listę powiązanych pozycji wyszukiwania. Musimy wybrać odpowiednią opcję, aby zainstalować pakiet w rozwiązaniu.
Korzystanie z wiersza poleceń programu Visual Studio
W programie Visual Studio przejdź do menu Narzędzia -> Menedżer pakietów NuGet -> Konsola menedżera pakietów
Wprowadź następujący wiersz w zakładce konsoli menedżera pakietów:
Install-Package IronPdf
Teraz pakiet zostanie pobrany/zainstalowany w bieżącym projekcie i będzie gotowy do użycia.
Bezpośrednie pobranie ze strony NuGet
Trzecim sposobem jest pobranie pakietu NuGet bezpośrednio ze strony internetowej.
- Przejdź do strony pakietu NuGet IronPdf.
- Wybierz opcję pakietu do pobrania z menu po prawej stronie.
- Kliknij dwukrotnie pobrany pakiet. Zostanie zainstalowany automatycznie.
- Następnie przeładuj rozwiązanie i zacznij z niego korzystać w projekcie.
Bezpośrednie pobranie ze strony internetowej IronPDF
Pobierz najnowszy pakiet bezpośrednio ze strony internetowej 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ę "Dodaj odwołanie" i przejdź do lokalizacji pobranego pliku.
- Następnie kliknij OK, aby dodać odwołanie.
Zainstaluj bibliotekę Winnovative
Bibliotekę Winnovative można pobrać i zainstalować na cztery sposoby.
Są to:
- Korzystanie z programu Visual Studio.
- Using the Visual Studio Command-Line.
- Direct download from the NuGet website.
- Bezpośrednie pobranie ze strony internetowej Winnovative.
Korzystanie z programu Visual Studio
Przejdź do menedżera pakietów NuGet, jak powyżej, i wyszukaj hasło "Winnovative". Poniżej wyświetli się lista powiązanych wyników:
Korzystając z Winnovative, musimy zainstalować wiele różnych bibliotek, aby móc korzystać ze wszystkich funkcji. Wybierz żądaną bibliotekę i kliknij "Zainstaluj", aby zainstalować ją w projekcie.
Need to install Winnovative.PdfToText.NetCore for reading the PDF and converting them into text.
Korzystanie z wiersza poleceń programu Visual Studio
W programie Visual Studio przejdź do menu Narzędzia -> Menedżer pakietów NuGet -> Konsola menedżera pakietów
Wprowadź następujące wiersze w zakładce konsoli menedżera pakietów dla każdej potrzebnej funkcji:
Install-Package Winnovative.HtmlToPdf.NetCore
Install-Package Winnovative.PdfToText.NetCore
Install-Package Winnovative.HtmlToPdf.NetCore
Install-Package Winnovative.PdfToText.NetCore
The package will now download/install to the current project and be ready to use.
Bezpośrednie pobranie ze strony NuGet
Trzecim sposobem jest pobranie pakietu NuGet bezpośrednio ze strony internetowej.
- Przejdź do wyników wyszukiwania pakietów NuGet Winnovative.
- Wybierz wymagany pakiet, co spowoduje przekierowanie do innej strony.
- Następnie wybierz opcję pakietu do pobrania z menu po prawej stronie.
- Kliknij dwukrotnie pobrany pakiet. Zostanie zainstalowany automatycznie.
- Następnie przeładuj rozwiązanie i zacznij z niego korzystać w projekcie.
Bezpośrednie pobranie ze strony internetowej Winnovative
Pobierz najnowszy pakiet bezpośrednio ze strony internetowej Winnovative. Po pobraniu wykonaj poniższe kroki, aby dodać pakiet do projektu.
- Kliknij prawym przyciskiem myszy projekt w oknie rozwiązania.
- Następnie wybierz opcję "Dodaj odwołanie" i przejdź do lokalizacji pobranego pliku.
- Następnie kliknij OK, aby dodać odwołanie.
Tworzenie dokumentów PDF z adresów URL
Obie biblioteki PDF pomagają nam konwertować strony HTML na eleganckie pliki PDF. Przyjrzyjmy się, jak możemy utworzyć dokument PDF.
Korzystanie z IronPDF
IronPDF pozwala nam szybko tworzyć dokumenty PDF. Utworzy plik HTML i przekonwertuje go na dokument PDF na podstawie adresu URL. Wbudowana przeglądarka Chrome w IronPDF pomoże nam w pobraniu ciągu HTML.
Poniższe kroki ułatwiają tworzenie dokumentów PDF.
// Create a ChromePdfRenderer instance
IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();
// Convert a webpage into a PDF and save it
var Pdf = Renderer.RenderUrlAsPdf("https://www.google.co.in/");
Pdf.SaveAs("result.pdf");
// Alternatively, chain the methods for brevity
var Renderer = new IronPdf.ChromePdfRenderer()
.RenderUrlAsPdf("https://www.google.co.in/")
.SaveAs("result.pdf");
// Create a ChromePdfRenderer instance
IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();
// Convert a webpage into a PDF and save it
var Pdf = Renderer.RenderUrlAsPdf("https://www.google.co.in/");
Pdf.SaveAs("result.pdf");
// Alternatively, chain the methods for brevity
var Renderer = new IronPdf.ChromePdfRenderer()
.RenderUrlAsPdf("https://www.google.co.in/")
.SaveAs("result.pdf");
' Create a ChromePdfRenderer instance
Dim Renderer As New IronPdf.ChromePdfRenderer()
' Convert a webpage into a PDF and save it
Dim Pdf = Renderer.RenderUrlAsPdf("https://www.google.co.in/")
Pdf.SaveAs("result.pdf")
' Alternatively, chain the methods for brevity
Dim Renderer = (New IronPdf.ChromePdfRenderer()).RenderUrlAsPdf("https://www.google.co.in/").SaveAs("result.pdf")
W powyższym przykładzie mamy dwie opcje przekształcenia linku w dokument. Making a document via constructing an IronPDF object is one method, while making a RenderUrlAsPdf object is the other.
The above implies that we can turn it into a document using RenderUrlAsPdf. Należy podać jedynie lokalizację zapisu oraz link. Konwersja pliku PDF do formatu dokumentu zajmuje 2,5 sekundy.
Korzystanie z Winnovative
Za pomocą biblioteki Winnovative możemy przekształcić dokument PDF. Biblioteka Winnovative zawiera wbudowaną przeglądarkę, która pomoże nam pobrać kod HTML z adresu URL i przekonwertować go do formatu PDF.
Poniżej znajduje się kod służący do pobrania i konwersji ciągu znaków HTML do pliku PDF:
// Create a HtmlToPdfConverter instance
HtmlToPdfConverter htmlToPdfConverter = new HtmlToPdfConverter();
// Download HTML from URL and convert to PDF
htmlToPdfConverter.ConvertUrlToFile("https://www.google.co.in/", "result1.pdf");
// Create a HtmlToPdfConverter instance
HtmlToPdfConverter htmlToPdfConverter = new HtmlToPdfConverter();
// Download HTML from URL and convert to PDF
htmlToPdfConverter.ConvertUrlToFile("https://www.google.co.in/", "result1.pdf");
' Create a HtmlToPdfConverter instance
Dim htmlToPdfConverter As New HtmlToPdfConverter()
' Download HTML from URL and convert to PDF
htmlToPdfConverter.ConvertUrlToFile("https://www.google.co.in/", "result1.pdf")
First, we are creating an object for the HtmlToPdfConverter which allows us to use the list of options to convert the web URL into a PDF. ConvertUrlToFile is the method that helps us to download the source from the URL and convert it into a PDF file. We need to pass two parameters: the URL and PDF file location — both are mandatory.
Czas potrzebny na przekształcenie adresu URL w dokument PDF wynosi 6,11 sekundy.
Poniższy obrazek przedstawia porównanie między IronPDF a Winnovative.
Tworzenie plików PDF z ciągów znaków HTML
Istniejące strony HTML lub kod HTML można konwertować do formatu PDF za pomocą zarówno IronPDF, jak i Winnovative. Pomogą nam one w tworzeniu wysokiej jakości dokumentów PDF.
Korzystanie z IronPDF
We can transform HTML strings into PDF documents with the help of IronPDF. The following is an example of how to turn an HTML string into a document. Posiada również możliwość przekształcania dowolnego tagu HTML w dokument PDF.
// Convert HTML string to a PDF document and save
var Renderer = new IronPdf.ChromePdfRenderer()
.RenderHtmlAsPdf("<h1>Hello world!!</h1>")
.SaveAs("result.pdf");
// Convert HTML string to a PDF document and save
var Renderer = new IronPdf.ChromePdfRenderer()
.RenderHtmlAsPdf("<h1>Hello world!!</h1>")
.SaveAs("result.pdf");
' Convert HTML string to a PDF document and save
Dim Renderer = (New IronPdf.ChromePdfRenderer()).RenderHtmlAsPdf("<h1>Hello world!!</h1>").SaveAs("result.pdf")
The accompanying example shows how to translate an HTML string with RenderHtmlAsPdf. Ponadto funkcja konwertująca HTML na ciąg znaków może przyjmować dowolną liczbę kodów HTML. Using the SaveAs function, we can save the document after getting the string. Cały proces zajmuje zaledwie dwie sekundy.
Korzystanie z Winnovative
Możemy użyć biblioteki Winnovative do konwersji ciągu znaków HTML na dokument PDF. Jest prosty i łatwy w użyciu.
Poniżej przedstawiono przykładowy kod służący do tworzenia pliku PDF na podstawie ciągu znaków HTML.
// Create a HtmlToPdfConverter instance
HtmlToPdfConverter htmlToPdfConverter = new HtmlToPdfConverter();
// Convert HTML string to a PDF and save
htmlToPdfConverter.ConvertHtmlToFile("<h1>Hello world!!</h1>", "", "result1.pdf");
// Create a HtmlToPdfConverter instance
HtmlToPdfConverter htmlToPdfConverter = new HtmlToPdfConverter();
// Convert HTML string to a PDF and save
htmlToPdfConverter.ConvertHtmlToFile("<h1>Hello world!!</h1>", "", "result1.pdf");
' Create a HtmlToPdfConverter instance
Dim htmlToPdfConverter As New HtmlToPdfConverter()
' Convert HTML string to a PDF and save
htmlToPdfConverter.ConvertHtmlToFile("<h1>Hello world!!</h1>", "", "result1.pdf")
First, we are creating an object for the HtmlToPdfConverter, which allows us to use the list of options to convert the HTML into a PDF. ConvertHtmlToFile is the method that helps us to convert the HTML string into a PDF file. We should pass three parameters: the HTML string, the source URI (optional), and PDF file location. Ciąg HTML i lokalizacja pliku są parametrami obowiązkowymi. Proces trwał 3,6 sekundy.
Poniżej znajduje się wynik porównania między IronPDF a Winnovative.
Czytanie dokumentów PDF
Dzięki bibliotekom IronPDF i Winnovative możemy również odczytywać pliki PDF. Dokumenty można łatwo przekształcić w ciąg tekstowy. Aby wyodrębnić tekst, możemy użyć jednej z dwóch technik. Pierwsza metoda zwraca wszystkie dane strony jako pojedynczy ciąg znaków. Drugą techniką jest pobieranie danych strona po stronie, co jest metodą obsługiwanej przez obie biblioteki.
Korzystanie z IronPDF
Program IronPDF pozwala nam odczytywać istniejące pliki PDF i konwertować strony PDF na obiekty PDF. The following is an example of how to use IronPDF to read an existing PDF.
Pierwsze podejście do pobrania wszystkich ciągów znaków przedstawiono poniżej.
// Load a PDF document
var pdfDocument = IronPdf.PdfDocument.FromFile("result.pdf");
// Extract all text from the PDF
string allText = pdfDocument.ExtractAllText();
// Load a PDF document
var pdfDocument = IronPdf.PdfDocument.FromFile("result.pdf");
// Extract all text from the PDF
string allText = pdfDocument.ExtractAllText();
' Load a PDF document
Dim pdfDocument = IronPdf.PdfDocument.FromFile("result.pdf")
' Extract all text from the PDF
Dim allText As String = pdfDocument.ExtractAllText()
The FromFile method is used to read PDFs from an existing file and transform it into PDF-document objects, as shown in the code above. Za pomocą tego obiektu możemy odczytywać tekst i obrazy dostępne na stronach pliku PDF. The object has a method called ExtractAllText that extracts all of the text from a PDF document into a string.
Korzystanie z Winnovative
Ponadto firma Winnovative pomaga nam w odczytywaniu istniejących plików PDF. Powinien on również wspierać dwa podejścia wspomniane powyżej.
Poniżej przedstawiono przykładowy kod dla pierwszej metody konwersji wszystkich danych PDF do pojedynczego ciągu znaków.
// Load a document and count the number of pages
var pdfDoc = new PdfToText.Document("result1.pdf");
PdfToTextConverter pdfToTextConverter = new PdfToTextConverter();
// Convert PDF pages to text
string extractedText = pdfToTextConverter.ConvertToText("result1.pdf", 1, pdfDoc.Pages.Count);
// Load a document and count the number of pages
var pdfDoc = new PdfToText.Document("result1.pdf");
PdfToTextConverter pdfToTextConverter = new PdfToTextConverter();
// Convert PDF pages to text
string extractedText = pdfToTextConverter.ConvertToText("result1.pdf", 1, pdfDoc.Pages.Count);
' Load a document and count the number of pages
Dim pdfDoc = New PdfToText.Document("result1.pdf")
Dim pdfToTextConverter As New PdfToTextConverter()
' Convert PDF pages to text
Dim extractedText As String = pdfToTextConverter.ConvertToText("result1.pdf", 1, pdfDoc.Pages.Count)
W powyższym kodzie widać, że odczytujemy istniejący dokument, aby przekształcić go w obiekty w celu uzyskania liczby stron i innych informacji związanych z dokumentem. After this, we use the PdfToTextConverter library and create an object for that library. Tworząc obiekt, uzyskujemy dostęp do wszystkich dostępnych metod. We are also using a method called ConvertToText which helps us to convert the PDF pages into text. There are three parameters we need to pass, which are filepath, start page, and end page. All the parameters are mandatory.
Poniżej znajduje się wynik porównania między IronPDF a Winnovative.
Licencjonowanie
IronPDF is also a library and it comes with a free license for developers. Whenever we are using IronPDF in a production environment: the Lite package starts with $799 with no ongoing costs. As well as SaaS and OEM redistribution. Wszystkie licencje obejmują 30-dniową gwarancję zwrotu pieniędzy, roczną pomoc techniczną i aktualizacje, ważność na środowiska deweloperskie, testowe i produkcyjne, a także licencję stałą (jednorazowy zakup). Also, some with free time-limited licenses. See the full price structure and licensing for IronPDF. IronPDF also provides royalty-free license redistribution coverage.
Winnovative comes with both free and paid licenses. It comes with a free developer license. The HTML-to-PDF converter library starts at $450, and redistributable packages from $1200. The PDF toolkit pro license starts from $650. Each library has a different price range. To learn more about the licenses, check Winnovative pricing.
Wnioski
IronPDF is one of the most commonly used PDF-converter libraries. It helps us to generate, read, manipulate and format PDF files. IronPDF has a browser engine that will help to convert a given URL into a PDF file. It also allows us to add CSS to HTML strings and convert them to PDF files. Further, we can fill out PDF forms with the help of the IronPDF library. All the features of IronPDF have been included in one library.
The Winnovative PDF library helps us to generate, read and manipulate PDF files. We are also able to convert documents from URL or HTML string to PDF. In the HTML string we are able to add CSS. All the features of Winnovative have been split into multiple libraries. We need to download the specific library to be able to access a specific feature.
IronPDF comes with various price structures. The basic price for IronPDF starts at $799. There is a one-year fee for product support and updates. IronPDF provides royalty-free redistribution coverage for an extra cost. The Winnovative PDF Library also comes with a different price structure. The basic price of the Winnovative PDF Toolkit starts at $650. It includes one year of support and product updates.
To summarize, we recommend IronPDF because of its excellent performance and the large number of features made available to developers working with the Portable Document Format. It also provides excellent assistance and documentation, allowing us to fully exploit all of IronPDF's features. It is also more cost-effective when compared to Winnovative.
Często Zadawane Pytania
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 dokumenty PDF. Obsługuje ona również konwersję plików HTML i adresów URL stron internetowych na pliki PDF.
Jakie są kluczowe cechy IronPDF w porównaniu z Winnovative?
IronPDF oferuje jedną bibliotekę z kompleksowymi funkcjami, w tym scalanie, dzielenie oraz wyodrębnianie tekstu i obrazów z plików PDF. Wykorzystuje wbudowany silnik Chrome do konwersji HTML na PDF. Winnovative wymaga wielu bibliotek dla różnych funkcji i obsługuje HTML5 oraz formularze PDF do wypełnienia.
Czy można wyodrębnić tekst z pliku PDF za pomocą IronPDF?
Tak, IronPDF udostępnia metodę ExtractAllText, która pozwala programistom na wydajne wyodrębnianie całej treści tekstowej z dokumentu PDF.
Jakie są opcje licencyjne dla IronPDF?
IronPDF oferuje elastyczne opcje licencyjne, w tym podstawową Lite License bez bieżących kosztów. Oferuje różne plany cenowe dostosowane do różnych potrzeb programistów, co czyni go opłacalnym rozwiązaniem.
Czy do korzystania z IronPDF potrzebne jest oprogramowanie innych firm?
Nie, IronPDF nie wymaga żadnego oprogramowania innych firm. Wykorzystuje własny, wbudowany silnik Chrome do konwersji HTML na PDF, zapewniając uproszczony proces instalacji i użytkowania.
Jak zainstalować IronPDF w projekcie .NET?
IronPDF można zainstalować w projekcie .NET za pomocą programu Visual Studio, wiersza poleceń Visual Studio lub bezpośrednio z NuGet. Konfiguracja jest prosta i nie wymaga dodatkowego oprogramowania.
Jakie środowiska są obsługiwane przez IronPDF?
IronPDF obsługuje różne środowiska, w tym .NET Framework i .NET Core. Działa płynnie z aplikacjami internetowymi ASP.NET i aplikacjami Windows, zapewniając elastyczne opcje wdrażania.
Czy IronPDF może tworzyć interaktywne dokumenty PDF?
Tak, IronPDF obsługuje tworzenie interaktywnych dokumentów PDF. Umożliwia programistom wypełnianie formularzy, dodawanie adnotacji oraz umieszczanie elementów interaktywnych w plikach PDF.
Jakie są typowe scenariusze rozwiązywania problemów podczas korzystania z IronPDF?
Typowe scenariusze rozwiązywania problemów obejmują upewnienie się, że zainstalowana jest właściwa wersja .NET Framework, sprawdzenie, czy wszystkie zależności są poprawnie odwołane, oraz sprawdzenie poprawności konwertowanej treści HTML.
W jaki sposób IronPDF i Winnovative obsługują wypełnianie formularzy PDF?
IronPDF pozwala programistom na wydajne tworzenie i wypełnianie interaktywnych formularzy PDF. Winnovative również obsługuje wypełnianie formularzy, oferując narzędzia do zapisywania i edycji formularzy PDF z możliwością wypełniania.



