产品比较 IronPDF与PDFShift之间的比较 Curtis Chau 已更新:七月 28, 2025 Download IronPDF NuGet 下载 DLL 下载 Windows 安装程序 Start Free Trial Copy for LLMs Copy for LLMs Copy page as Markdown for LLMs Open in ChatGPT Ask ChatGPT about this page Open in Gemini Ask Gemini about this page Open in Grok Ask Grok about this page Open in Perplexity Ask Perplexity about this page Share Share on Facebook Share on X (Twitter) Share on LinkedIn Copy URL Email article The Portable Document Format (PDF) is the most popular document format for representing text, links, buttons, graphics, and much more in a single document. Manipulating PDFs in the C# programming language is near impossible without using a PDF API for C#. In this article, we will explore how to interact with and manipulate PDF documents using two different APIs, and also compare both APIs on their performance, features, and licensing. The PDF APIs we will discuss in this article are: IronPDF PDFShift 1. IronPDF IronPDF is a powerful HTML-to-PDF conversion API. IronPDF is the ideal solution for converting HTML sites in .NET and .NET Core development. It not only transforms HTML, but also has a variety of additional functions. IronPDF allows developers to create, alter, and retrieve PDF documents in .NET Core and .NET Framework projects. Using the IronPDF package, developers may easily produce or change PDFs from HTML pages. A PDF can be easily edited, stamped, and headers and footers added. It also makes it incredibly easy to read PDF text and extract pictures. IronPDF 使用 .NET Chromium 引擎将 HTML 页面渲染为 PDF 文件。 1.1. IronPDF Features 1.1.1. PDF Conversions 此功能包括从不同格式(如 HTML、HTML 字符串、MVC 视图、Web 表单和 URL)创建 PDF。 1.1.2. PDF Imaging This allows users to create images from PDFs and to create PDFs from images. 它包括图像提取、不同比图片扩展的支持以及 PDF 打印。 1.1.3. PDF Files I/O IronPDF also provides features for 128-bit encryption, locking with passwords, and digitally signing. 1.1.4. Editing PDFs This feature of IronPDF provides all types of PDF formatting, such as adding watermarks, adding pages, removing pages, adding backgrounds, adding foregrounds, and much more. 简而言之,IronPDF 提供了您需要操作 PDF 的所有功能。 1.1.5. PDF Content Extraction 在许多情况下,您可以直接从 PDF 中提取嵌入的文本。 If that doesn't work, your text is probably actually embedded in an image. Use the IronOCR library to scan documents for visual text, not plain text. 1.1.6. Headers and Footers Headers and footers can be added when a PDF is created or added to existing PDFs. The Print Options property allows you to craft a header and footer for each document page. 在 Chrome PDF 渲染器对象上访问这些选项。 This sample works inside a .NET Core console app. 1.1.7. Compatibility IronPDF 支持几乎所有与 C# 兼容的操作系统和框架,包括以下: Windows Linux .NET Core 2.1、3.0、3.1、.NET 6 & 5 符合 .NET 标准 2.0,实现通用兼容性 Microsoft Azure Amazon Web Services (AWS) Docker 2. PDFShift PDFShift 是一个 HTML 到 PDF 转换的 API 工具,使组织能够在几秒钟内将 HTML 页面转换为 PDF。 Parallel conversions, asynchronous queries, raw HTML support, and other capabilities are available through the cloud-server-based API tool. PDFShift is a simple-to-use solution that supports a wide range of developer languages, including Ruby, Python, JavaScript, Node, and PHP to make the conversion process easier. PDFShift allows customers to establish custom headers and footers, apply custom CSS, encrypt files, and much more to give enterprises complete control over their conversions. 2.1. PDFShift Features 2.1.1. Parallel conversions PDFShift supports parallel conversions, allowing users to convert multiple documents at once to increase conversion speed. 2.1.2. Advanced headers and footers Options Create custom headers and footers with page numbers, use custom CSS and JavaScript, encrypt your documents, and more. 2.1.3. Raw HTML data to PDF Conversion API PDFShift supports raw HTML-to-PDF conversion without making pages public. 2.1.4. High-Accuracy PDF PDFShift converts HTML to high-fidelity PDF documents in a matter of seconds. 2.1.5. Asynchronous requests To be alerted when a conversion is complete, use our sophisticated real-time system. Use the powerful PDFShift API to convert HTML to PDF and integrate the system with only three lines of code. 3. Creating a New Project in Visual Studio 打开 Visual Studio 软件并转到文件菜单。 Select "new project" and then select a console application. 在这篇文章中,我们将使用控制台应用程序生成PDF文档。 在适当的文本框中输入项目名称并选择路径。 然后,单击创建按钮。 根据下面的截图选择所需的 .NET 框架: 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. 现在我们可以添加库并测试程序。 4. Install the IronPDF Library IronPDF库有四种不同的下载和安装方式。 这些是: 使用 Visual Studio NuGet 包管理器 使用 Visual Studio 命令行 Direct Download from the NuGet Webpage Direct Download from the IronPDF Webpage 4.1 Using the Visual Studio NuGet Package Manager Visual Studio软件提供NuGet包管理器选项直接将包安装到解决方案。 下面的截图显示了如何打开NuGet包管理器。 It provides a search box to show the list of available package libraries from the NuGet website. In the package manager, we need to search for the keyword "IronPDF," as in the below screenshot 在上图中,我们可以看到从搜索中获得的相关包列表。 我们需要选择 IronPDF 选项并将包安装到我们的解决方案中。 4.2 使用Visual Studio命令行 In the Visual Studio menu, Go to Tools > NuGet Package manager > Package manager console 在包管理器控制台选项卡中输入以下行: Install-Package IronPdf 现在包将下载/安装到当前项目,并可以使用了。 4.3 Direct Download from the NuGet Webpage The third way is to download the NuGet package directly from the webpage. Navigate to the NuGet IronPDF Package Webpage 从右侧菜单中选择下载包选项。 双击下载的包; 它将自动安装。 Now reload the solution and begin using it in the project. 4.4 Direct Download from the IronPDF Webpage 从IronPDF下载页面直接下载最新包。 下载后,按照以下步骤将包添加到项目中。 从解决方案窗口右键点击项目。 然后,选择参考选项并浏览下载的参考的存放位置。 然后,单击确定以添加参考。 5. PDFShift Working PDFShift can't be integrated into a project — instead, it works remotely. You need to submit a POST request to PDFShift's API using the C# RestClient package by simply giving your API key as the user argument of simple authentication. The server receives your request, processes it, and gives back the output file all, and the working on the PDF conversion API is done by HTTP post request. PDFShift offers an API in many languages and works remotely for all of them. 6. Make PDFs from HTML Both tools include this functionality for HTML conversion, although they do so in somewhat different ways. 6.1. Creating PDF from URL using IronPDF Creating a PDF file in C# using a URL is just as easy as the above example with just these three lines of code. The following code will demonstrate how to create PDF files from a URL. using IronPdf; var Renderer = new IronPdf.ChromePdfRenderer(); // Create a PDF from a URL or local file path using var pdf = Renderer.RenderUrlAsPdf("https://www.amazon.com/?tag=hp2-brobookmark-us-20"); // Export to a file or Stream pdf.SaveAs("url.pdf"); using IronPdf; var Renderer = new IronPdf.ChromePdfRenderer(); // Create a PDF from a URL or local file path using var pdf = Renderer.RenderUrlAsPdf("https://www.amazon.com/?tag=hp2-brobookmark-us-20"); // Export to a file or Stream pdf.SaveAs("url.pdf"); Imports IronPdf Private Renderer = New IronPdf.ChromePdfRenderer() ' Create a PDF from a URL or local file path Private pdf = Renderer.RenderUrlAsPdf("https://www.amazon.com/?tag=hp2-brobookmark-us-20") ' Export to a file or Stream pdf.SaveAs("url.pdf") $vbLabelText $csharpLabel 以下是上述代码的输出。 6.2. HTML to PDF using IronPDF 使用 IronPDF C# .NET 库将 HTML 转换为 PDF 非常简单。 using IronPdf; var pdf = new ChromePdfRenderer(); PdfDocument doc = pdf.RenderHtmlAsPdf("<h1>This is a heading</h1>"); doc.SaveAs("FirstPDFDocument.pdf"); using IronPdf; var pdf = new ChromePdfRenderer(); PdfDocument doc = pdf.RenderHtmlAsPdf("<h1>This is a heading</h1>"); doc.SaveAs("FirstPDFDocument.pdf"); Imports IronPdf Private pdf = New ChromePdfRenderer() Private doc As PdfDocument = pdf.RenderHtmlAsPdf("<h1>This is a heading</h1>") doc.SaveAs("FirstPDFDocument.pdf") $vbLabelText $csharpLabel 6.3. Creating PDF from URL using PDFShift Converting a URL with PDFShift is very easy. All you have to do is send a POST request with the source parameter set to the URL, as with the following: using System; using RestSharp; using RestSharp.Authenticators; using System.IO; namespace PDFShiftExample { class Program { static void Main(string[] args) { var client = new RestClient("https://api.pdfshift.io/v3/convert/pdf"); client.Authenticator = new HttpBasicAuthenticator("api", "your_api_key"); var request = new RestRequest(Method.POST); var json = new { source = "https://www.example.com" }; request.AddJsonBody(json); var response = client.Execute(request); if (!response.IsSuccessful) { // Handle the unsuccessful response } else { File.WriteAllBytes("result.pdf", response.RawBytes); } } } } using System; using RestSharp; using RestSharp.Authenticators; using System.IO; namespace PDFShiftExample { class Program { static void Main(string[] args) { var client = new RestClient("https://api.pdfshift.io/v3/convert/pdf"); client.Authenticator = new HttpBasicAuthenticator("api", "your_api_key"); var request = new RestRequest(Method.POST); var json = new { source = "https://www.example.com" }; request.AddJsonBody(json); var response = client.Execute(request); if (!response.IsSuccessful) { // Handle the unsuccessful response } else { File.WriteAllBytes("result.pdf", response.RawBytes); } } } } Imports System Imports RestSharp Imports RestSharp.Authenticators Imports System.IO Namespace PDFShiftExample Friend Class Program Shared Sub Main(ByVal args() As String) Dim client = New RestClient("https://api.pdfshift.io/v3/convert/pdf") client.Authenticator = New HttpBasicAuthenticator("api", "your_api_key") Dim request = New RestRequest(Method.POST) Dim json = New With {Key .source = "https://www.example.com"} request.AddJsonBody(json) Dim response = client.Execute(request) If Not response.IsSuccessful Then ' Handle the unsuccessful response Else File.WriteAllBytes("result.pdf", response.RawBytes) End If End Sub End Class End Namespace $vbLabelText $csharpLabel 6.4. HTML-to-PDF using PDFShift PDFShift also provides HTML-to-PDF direct conversion, but reads HTML content from HTML files. using System; using System.IO; using RestSharp; using RestSharp.Authenticators; namespace PDFShiftExample { class Program { static void Main(string[] args) { var client = new RestClient("https://api.pdfshift.io/v3/convert/pdf"); client.Authenticator = new HttpBasicAuthenticator("api", "your_api_key"); var request = new RestRequest(Method.POST); string documentContent = File.ReadAllText("document.html"); var json = new { source = documentContent }; request.AddJsonBody(json); var response = client.Execute(request); if (!response.IsSuccessful) { // Handle the unsuccessful response } else { File.WriteAllBytes("result.pdf", response.RawBytes); } } } } using System; using System.IO; using RestSharp; using RestSharp.Authenticators; namespace PDFShiftExample { class Program { static void Main(string[] args) { var client = new RestClient("https://api.pdfshift.io/v3/convert/pdf"); client.Authenticator = new HttpBasicAuthenticator("api", "your_api_key"); var request = new RestRequest(Method.POST); string documentContent = File.ReadAllText("document.html"); var json = new { source = documentContent }; request.AddJsonBody(json); var response = client.Execute(request); if (!response.IsSuccessful) { // Handle the unsuccessful response } else { File.WriteAllBytes("result.pdf", response.RawBytes); } } } } Imports System Imports System.IO Imports RestSharp Imports RestSharp.Authenticators Namespace PDFShiftExample Friend Class Program Shared Sub Main(ByVal args() As String) Dim client = New RestClient("https://api.pdfshift.io/v3/convert/pdf") client.Authenticator = New HttpBasicAuthenticator("api", "your_api_key") Dim request = New RestRequest(Method.POST) Dim documentContent As String = File.ReadAllText("document.html") Dim json = New With {Key .source = documentContent} request.AddJsonBody(json) Dim response = client.Execute(request) If Not response.IsSuccessful Then ' Handle the unsuccessful response Else File.WriteAllBytes("result.pdf", response.RawBytes) End If End Sub End Class End Namespace $vbLabelText $csharpLabel 7. Custom Headers and Footers Adding headers and footers to PDFs is a must-have when dealing with PDFs. Both the tools under discussion support this option. 7.1. Custom Headers and Footers using IronPDF Using IronPDF you can add headers and footers in two distinct ways. TextHeaderFooter allows text-based headers to be added, with the option to merge in dynamic data. HtmlHeaderFooter allows the developer to render HTML headers and footers to PDF files, also allowing the templating of dynamic data. It is more flexible but harder to use. using IronPdf; var Renderer = new IronPdf.ChromePdfRenderer(); Renderer.RenderingOptions.FirstPageNumber = 1; // use 2 if a coverpage will be appended Renderer.RenderingOptions.TextHeader.DrawDividerLine = true; Renderer.RenderingOptions.TextHeader.CenterText = "{url}"; Renderer.RenderingOptions.TextHeader.Font = IronPdf.Font.FontTypes.Helvetica; Renderer.RenderingOptions.TextHeader.FontSize = 12; using IronPdf; var Renderer = new IronPdf.ChromePdfRenderer(); Renderer.RenderingOptions.FirstPageNumber = 1; // use 2 if a coverpage will be appended Renderer.RenderingOptions.TextHeader.DrawDividerLine = true; Renderer.RenderingOptions.TextHeader.CenterText = "{url}"; Renderer.RenderingOptions.TextHeader.Font = IronPdf.Font.FontTypes.Helvetica; Renderer.RenderingOptions.TextHeader.FontSize = 12; Imports IronPdf Private Renderer = New IronPdf.ChromePdfRenderer() Renderer.RenderingOptions.FirstPageNumber = 1 ' use 2 if a coverpage will be appended Renderer.RenderingOptions.TextHeader.DrawDividerLine = True Renderer.RenderingOptions.TextHeader.CenterText = "{url}" Renderer.RenderingOptions.TextHeader.Font = IronPdf.Font.FontTypes.Helvetica Renderer.RenderingOptions.TextHeader.FontSize = 12 $vbLabelText $csharpLabel 7.2. Custom Headers and Footers using PDFShift You can customize the resulting document by adding a custom header or footer. These are frequently used to identify the current page or display your company's logo on every page. using System; using RestSharp; using RestSharp.Authenticators; using System.IO; namespace PDFShiftExample { class Program { static void Main(string[] args) { var client = new RestClient("https://api.pdfshift.io/v3/convert/pdf"); client.Authenticator = new HttpBasicAuthenticator("api", "your_api_key"); var request = new RestRequest(Method.POST); var json = new { source = "https://quillbot.com/", footer = new { source = "<div style=\"font-size: 12px\">Page {{page}} of {{total}}</div>", spacing = "50px" } }; request.AddJsonBody(json); var response = client.Execute(request); if (!response.IsSuccessful) { // Handle the unsuccessful response } else { File.WriteAllBytes("result.pdf", response.RawBytes); } } } } using System; using RestSharp; using RestSharp.Authenticators; using System.IO; namespace PDFShiftExample { class Program { static void Main(string[] args) { var client = new RestClient("https://api.pdfshift.io/v3/convert/pdf"); client.Authenticator = new HttpBasicAuthenticator("api", "your_api_key"); var request = new RestRequest(Method.POST); var json = new { source = "https://quillbot.com/", footer = new { source = "<div style=\"font-size: 12px\">Page {{page}} of {{total}}</div>", spacing = "50px" } }; request.AddJsonBody(json); var response = client.Execute(request); if (!response.IsSuccessful) { // Handle the unsuccessful response } else { File.WriteAllBytes("result.pdf", response.RawBytes); } } } } Imports System Imports RestSharp Imports RestSharp.Authenticators Imports System.IO Namespace PDFShiftExample Friend Class Program Shared Sub Main(ByVal args() As String) Dim client = New RestClient("https://api.pdfshift.io/v3/convert/pdf") client.Authenticator = New HttpBasicAuthenticator("api", "your_api_key") Dim request = New RestRequest(Method.POST) Dim json = New With { Key .source = "https://quillbot.com/", Key .footer = New With { Key .source = "<div style=""font-size: 12px"">Page {{page}} of {{total}}</div>", Key .spacing = "50px" } } request.AddJsonBody(json) Dim response = client.Execute(request) If Not response.IsSuccessful Then ' Handle the unsuccessful response Else File.WriteAllBytes("result.pdf", response.RawBytes) End If End Sub End Class End Namespace $vbLabelText $csharpLabel 9. Watermarking Watermarking PDFs using a programming language is quite a difficult task. Both IronPDF and PDFShift provide support for watermarking PDFs. 9.1. Watermarking using IronPDF IronPDF provides methods to 'watermark' PDF documents with HTML. Watermarks may be set to render above or below existing content and have a built-in capacity for opacity, rotation, and hyperlinks. using IronPdf; var Renderer = new IronPdf.ChromePdfRenderer(); using var Pdf = Renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf"); Pdf.WatermarkAllPages("<h2 style='color:red'>SAMPLE</h2>", IronPdf.Editing.WaterMarkLocation.MiddleCenter, 50, -45, "https://www.nuget.org/packages/IronPdf"); Pdf.SaveAs(@"C:\Path\To\Watermarked.pdf"); using IronPdf; var Renderer = new IronPdf.ChromePdfRenderer(); using var Pdf = Renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf"); Pdf.WatermarkAllPages("<h2 style='color:red'>SAMPLE</h2>", IronPdf.Editing.WaterMarkLocation.MiddleCenter, 50, -45, "https://www.nuget.org/packages/IronPdf"); Pdf.SaveAs(@"C:\Path\To\Watermarked.pdf"); Imports IronPdf Private Renderer = New IronPdf.ChromePdfRenderer() Private Pdf = Renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf") Pdf.WatermarkAllPages("<h2 style='color:red'>SAMPLE</h2>", IronPdf.Editing.WaterMarkLocation.MiddleCenter, 50, -45, "https://www.nuget.org/packages/IronPdf") Pdf.SaveAs("C:\Path\To\Watermarked.pdf") $vbLabelText $csharpLabel 9.2. Watermarking using PDFShift Users need a watermark to clearly identify on PDFs. using System; using RestSharp; using RestSharp.Authenticators; using System.IO; namespace PDFShiftExample { class Program { static void Main(string[] args) { var client = new RestClient("https://api.pdfshift.io/v3/convert/pdf"); client.Authenticator = new HttpBasicAuthenticator("api", "your_api_key"); var request = new RestRequest(Method.POST); var json = new { source = "https://www.example.com", watermark = new { image = "https://pdfshift-dev.netlify.com/images/logo/logo-violet.png", offset_x = 50, offset_y = "100px", rotate = 45 } }; request.AddJsonBody(json); var response = client.Execute(request); if (!response.IsSuccessful) { // Handle the unsuccessful response } else { File.WriteAllBytes("result.pdf", response.RawBytes); } } } } using System; using RestSharp; using RestSharp.Authenticators; using System.IO; namespace PDFShiftExample { class Program { static void Main(string[] args) { var client = new RestClient("https://api.pdfshift.io/v3/convert/pdf"); client.Authenticator = new HttpBasicAuthenticator("api", "your_api_key"); var request = new RestRequest(Method.POST); var json = new { source = "https://www.example.com", watermark = new { image = "https://pdfshift-dev.netlify.com/images/logo/logo-violet.png", offset_x = 50, offset_y = "100px", rotate = 45 } }; request.AddJsonBody(json); var response = client.Execute(request); if (!response.IsSuccessful) { // Handle the unsuccessful response } else { File.WriteAllBytes("result.pdf", response.RawBytes); } } } } Imports System Imports RestSharp Imports RestSharp.Authenticators Imports System.IO Namespace PDFShiftExample Friend Class Program Shared Sub Main(ByVal args() As String) Dim client = New RestClient("https://api.pdfshift.io/v3/convert/pdf") client.Authenticator = New HttpBasicAuthenticator("api", "your_api_key") Dim request = New RestRequest(Method.POST) Dim json = New With { Key .source = "https://www.example.com", Key .watermark = New With { Key .image = "https://pdfshift-dev.netlify.com/images/logo/logo-violet.png", Key .offset_x = 50, Key .offset_y = "100px", Key .rotate = 45 } } request.AddJsonBody(json) Dim response = client.Execute(request) If Not response.IsSuccessful Then ' Handle the unsuccessful response Else File.WriteAllBytes("result.pdf", response.RawBytes) End If End Sub End Class End Namespace $vbLabelText $csharpLabel 8. Bootstrap and Modern CSS Framework Support Modern web development heavily relies on CSS frameworks like Bootstrap for rapid UI development and responsive design. PDF libraries must accurately convert these frameworks to maintain professional document quality. IronPDF: Full Bootstrap and Framework Support IronPDF's Chromium engine provides comprehensive support for modern CSS frameworks: Bootstrap 5: Full flexbox and CSS Grid with responsive utilities Bootstrap 4:完整的卡片系统、导航、表单组件 Tailwind CSS:所有实用类和响应式修饰符 Foundation:完整的网格和组件系统 现代 CSS3:Flexbox、Grid、自定义属性、动画、变换 Real-world validation: Bootstrap homepage and Bootstrap templates convert with pixel-perfect accuracy. Code Example: Contact Form with Bootstrap using IronPdf; var renderer = new ChromePdfRenderer(); string bootstrapContact = @" <!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 my-5'> <div class='row justify-content-center'> <div class='col-lg-8'> <div class='card shadow'> <div class='card-header bg-primary text-white'> <h2 class='mb-0'>Contact Us</h2> </div> <div class='card-body'> <form> <div class='row g-3'> <div class='col-md-6'> <label class='form-label'>First Name</label> <input type='text' class='form-control' placeholder='John'> </div> <div class='col-md-6'> <label class='form-label'>Last Name</label> <input type='text' class='form-control' placeholder='Doe'> </div> </div> <div class='mt-3'> <label class='form-label'>Email Address</label> <div class='input-group'> <span class='input-group-text'>@</span> <input type='email' class='form-control' placeholder='john.doe@example.com'> </div> </div> <div class='mt-3'> <label class='form-label'>Subject</label> <select class='form-select'> <option>General Inquiry</option> <option>Technical Support</option> <option>Sales Question</option> <option>Partnership Opportunity</option> </select> </div> <div class='mt-3'> <label class='form-label'>Message</label> <textarea class='form-control' rows='5' placeholder='Your message here...'></textarea> </div> <div class='d-flex justify-content-between align-items-center mt-4'> <div class='form-check'> <input class='form-check-input' type='checkbox' id='newsletter'> <label class='form-check-label' for='newsletter'> Subscribe to newsletter </label> </div> <button type='submit' class='btn btn-primary px-4'>Submit</button> </div> </form> </div> </div> <div class='alert alert-info mt-4 d-flex align-items-center' role='alert'> <svg class='bi flex-shrink-0 me-2' width='24' height='24'></svg> <div>We typically respond within 24 hours during business days.</div> </div> </div> </div> </div> </body> </html>"; var pdf = renderer.RenderHtmlAsPdf(bootstrapContact); pdf.SaveAs("contact-form.pdf"); using IronPdf; var renderer = new ChromePdfRenderer(); string bootstrapContact = @" <!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 my-5'> <div class='row justify-content-center'> <div class='col-lg-8'> <div class='card shadow'> <div class='card-header bg-primary text-white'> <h2 class='mb-0'>Contact Us</h2> </div> <div class='card-body'> <form> <div class='row g-3'> <div class='col-md-6'> <label class='form-label'>First Name</label> <input type='text' class='form-control' placeholder='John'> </div> <div class='col-md-6'> <label class='form-label'>Last Name</label> <input type='text' class='form-control' placeholder='Doe'> </div> </div> <div class='mt-3'> <label class='form-label'>Email Address</label> <div class='input-group'> <span class='input-group-text'>@</span> <input type='email' class='form-control' placeholder='john.doe@example.com'> </div> </div> <div class='mt-3'> <label class='form-label'>Subject</label> <select class='form-select'> <option>General Inquiry</option> <option>Technical Support</option> <option>Sales Question</option> <option>Partnership Opportunity</option> </select> </div> <div class='mt-3'> <label class='form-label'>Message</label> <textarea class='form-control' rows='5' placeholder='Your message here...'></textarea> </div> <div class='d-flex justify-content-between align-items-center mt-4'> <div class='form-check'> <input class='form-check-input' type='checkbox' id='newsletter'> <label class='form-check-label' for='newsletter'> Subscribe to newsletter </label> </div> <button type='submit' class='btn btn-primary px-4'>Submit</button> </div> </form> </div> </div> <div class='alert alert-info mt-4 d-flex align-items-center' role='alert'> <svg class='bi flex-shrink-0 me-2' width='24' height='24'></svg> <div>We typically respond within 24 hours during business days.</div> </div> </div> </div> </div> </body> </html>"; var pdf = renderer.RenderHtmlAsPdf(bootstrapContact); pdf.SaveAs("contact-form.pdf"); IRON VB CONVERTER ERROR developers@ironsoftware.com $vbLabelText $csharpLabel Output: A professional contact form with Bootstrap's form controls, grid layout, card styling, and input groups—all accurately rendered in PDF. PDFShift: Cloud-Based Service with Good Bootstrap Support PDFShift is a cloud API service that provides HTML-to-PDF conversion with generally good Bootstrap support: Cloud API: All conversions via HTTP API calls to PDFShift servers Bootstrap Support: Generally handles Bootstrap 4/5 layouts well CSS3 Support: Good flexbox and modern CSS rendering Internet Required: Cannot generate PDFs offline Per-Document Pricing: Charges per conversion, not per-developer license Key considerations for PDFShift: External Dependency: All PDF generation requires internet and external API availability Data Privacy: HTML content sent to third-party servers for processing Volume Costs: Per-document pricing can become expensive at scale Latency: Network round-trips add delay to each conversion No Offline Capability: Cannot work in air-gapped or offline environments Development impact: While PDFShift handles Bootstrap well, the cloud architecture introduces operational trade-offs: Ongoing per-document costs vs IronPDF's one-time per-developer license External service dependency vs local on-premises processing Data handling considerations for sensitive content Internet connectivity requirement vs offline capability For high-volume applications, on-premises requirements, or sensitive data handling, IronPDF's local processing model offers better long-term control and value. For Bootstrap best practices, see the Bootstrap & Flexbox CSS Guide. 9. 许可 IronPDF是一个提供免费开发者许可证的库。 IronPDF also offers a special price structure: the light package begins at $799, with no hidden costs. 也可以重新分发SaaS和OEM产品。 所有许可证包括30天退款保证、一年的软件支持和升级、开发/测试/阶段/生产有效性,以及永久许可证(一劳永逸)。 IronPDF licenses provide maximal performance for user needs. Go to this link to see IronPDF's Entire Pricing Structure and Licensing. The PDFShift PDF conversion API offers five different licensing packages on both a monthly and yearly basis. A system of "credits" is used for purchasing the various packages, and the details of this are listed as follows: Free package (50 credits per month) Startup (500 credits per month for $9 and 6,000 credits per year for $99) Boost (2,500 credits per month for $24 and 30,000 credits per year for $240) Growth (5,000 credits per month for $39 and 60,000 credits per year for $390) Business (25,000 credits per month for $99) There are also file size limits: the free package has a limit of 1MB per file, while for the other packages the limit is 5MB per file. For more information and pricing, visit the PDFShift Pricing Page. 10. 结论 IronPDF is a free application for indie developers that provides a variety of features and the capability to modify PDF files and convert them to other formats. IronPDF provides the best editing and formatting tools for PDF processing. It converts HTML-to-PDF results into a vector file suitable for high-quality commercial printing. As an outcome, you'll get a PDF that is clear and high-quality. For more details, check the Iron Software Licensing and Pricing Information. PDFShift is an HTML-to-PDF conversion API that is high-quality, high-fidelity, and powerful. It offers an easy-to-learn endpoint with an array of tools approaching a complete set of functions, as well as a package for several languages. PDFShift uses postMessage to send requests to the server that can handle the parallel conversion of documents — meaning that you can convert multiple documents at the same time. IronPDF licenses are developer-based, which means you should always purchase a license based on the number of developers who will use the product. PDFShift licenses, on the other hand, are monthly and yearly credits-based, which means you will receive specific credits per month based on your subscribed package. IronPDF supports OME and SaaS distribution, which PDFShift does not. IronPDF licenses are one-time purchases and you can use them for a lifetime, whereas PDFShift offers monthly and yearly licenses. After a quick comparison of both tools, we can conclude that the IronPDF library offers substantially more features than PDFShift. PDFShift provides only a small number of features for manipulating PDFs. IronPDF converts URLs to PDF with just three lines of code, but PDFShift needs many more lines of code to be able to perform the same task. Integrating IronPDF is easy and can be done in only a few minutes. PDFShift works in a cloud-based system and does not need to be integrated; however, it does depend on other APIs such as RestSharp, and so, in fact, it is a complex procedure. Further, Iron Software is currently offering a five-tool package for the price of just two. Iron Suite中包含的工具是: IronBarcode IronXL IronOCR IronPDF IronWebScraper Please visit this Iron Suite Page to explore the IRONSUITE. [{i:(PDFShift is a registered trademark of its respective owner. This site is not affiliated with, endorsed by, or sponsored by PDFShift. 所有产品名称、徽标和品牌均为其各自所有者的财产。 比较仅供参考,反映的是撰写时的公开信息。] 常见问题解答 如何在C#中将HTML转换为PDF? 你可以使用IronPDF的RenderHtmlAsPdf方法将HTML字符串转换为PDF。你还可以使用RenderHtmlFileAsPdf将HTML文件转换为PDF。 使用IronPDF进行PDF操作的好处是什么? IronPDF 提供了一套强大的 PDF 操作功能,包括从各种格式创建 PDF,图像提取,加密,编辑功能,以及与多种平台的兼容性,如 Windows、Linux 和 Azure、AWS 等云服务。 PDFShift 的关键功能是什么? PDFShift 是一个基于云的 API,支持快速的 HTML 到 PDF 转换,具有并行转换、自定义标题、异步请求等功能,并与多种编程语言兼容。 IronPDF 和 PDFShift 在许可方面有何不同? IronPDF 提供了一次性购买的开发者基础许可和30天退款保证。相比之下,PDFShift 使用基于信用的许可系统,包括月度和年度计划。 IronPDF 可以在云环境中使用吗? 是的,IronPDF 支持 Microsoft Azure 和 AWS 等云环境,使其在不同的部署场景中具有多功能性。 如何使用 IronPDF 向 PDF 添加页眉和页脚? IronPDF 允许您通过内置方法向 PDF 添加页眉和页脚,可以自定义为包含文本、图像或页码。 IronPDF 支持哪些平台? IronPDF 支持几乎所有与 C# 兼容的操作系统和框架,包括 Windows、Linux、.NET Core,也可以在云环境中使用。 如何在我的 Visual Studio 项目中安装 IronPDF? IronPDF 可以通过 Visual Studio NuGet 包管理器、Visual Studio 命令行安装,或直接从 NuGet 或 IronPDF 网页下载。 能否使用 IronPDF 从 PDF 中提取图像? 是的,IronPDF 提供了从 PDF 提取图像的功能,允许开发者操作和在原始文档之外重用图像。 Curtis Chau 立即与工程团队聊天 技术作家 Curtis Chau 拥有卡尔顿大学的计算机科学学士学位,专注于前端开发,精通 Node.js、TypeScript、JavaScript 和 React。他热衷于打造直观且美观的用户界面,喜欢使用现代框架并创建结构良好、视觉吸引力强的手册。除了开发之外,Curtis 对物联网 (IoT) 有浓厚的兴趣,探索将硬件和软件集成的新方法。在空闲时间,他喜欢玩游戏和构建 Discord 机器人,将他对技术的热爱与创造力相结合。 相关文章 已发布十一月 13, 2025 比较 C# HTML 到 PDF 开源与 IronPDF 比较开源 HTML 到 PDF 库与 IronPDF for C#。发现哪个解决方案为您的 .NET 项目提供最佳的 PDF 生成能力。 阅读更多 已发布十月 27, 2025 哪种 ASP.NET Core PDF 库性价比最高? 发现适合ASP.NET Core应用程序的最佳PDF库。比较IronPDF的Chrome引擎与Aspose和Syncfusion的替代品。 阅读更多 已发布十月 27, 2025 如何使用 Aspose C# 与 IronPDF 创作 PDF 通过此逐步指南,学习如何使用 Aspose C# 与 IronPDF 创建 PDF,专为开发人员设计。 阅读更多 IronPDF与NReco .NET Core之间的比较IronPDF与SautinSoft PDF Focus之...
已发布十一月 13, 2025 比较 C# HTML 到 PDF 开源与 IronPDF 比较开源 HTML 到 PDF 库与 IronPDF for C#。发现哪个解决方案为您的 .NET 项目提供最佳的 PDF 生成能力。 阅读更多
已发布十月 27, 2025 哪种 ASP.NET Core PDF 库性价比最高? 发现适合ASP.NET Core应用程序的最佳PDF库。比较IronPDF的Chrome引擎与Aspose和Syncfusion的替代品。 阅读更多
已发布十月 27, 2025 如何使用 Aspose C# 与 IronPDF 创作 PDF 通过此逐步指南,学习如何使用 Aspose C# 与 IronPDF 创建 PDF,专为开发人员设计。 阅读更多