跳過到頁腳內容
產品比較

IronPDF與Apitron PDF Kit的比較

在 C# 中,使用 PDF 文件對於開發人員來說可能是一項挑戰。 創建此類文件的內容需要考慮許多因素,當從不同格式轉換內容為 PDF 時,更是如此。 自動化現在是軟體開發過程中的關鍵。 這些問題現在已通過設計用來幫助閱讀、寫入、創建和修改 PDF 文檔的庫來解決,還可以編輯它們的屬性並將其從其他格式轉換過來。

這篇博客文章將對比兩個 .NET 和 .NET Core 的 PDF 庫。這兩個庫是:

  • The IronPDF library
  • The Apitron PDF Kit

IronPDF 和 Apitron PDF Kit 是提供 .NET 和 .NET Core 的 PDF 操作功能的兩個庫。 它們都可以用於文檔字段的轉換和操作任務。 它們都可以創建書籤。 接下來的問題是決定哪個 C# PDF .NET 庫最適合我們的 .NET 項目。 這篇比較文章將幫助您在這兩個 PDF 庫之間做出決定。

首先,讓我們來看看這兩個庫有什麼可提供的,然後再進行比較。

Apitron PDF Kit 庫及其功能

Apitron PDF Kit 是一個 .NET 組件,允許您以任何方式操作或轉換 PDF 文件。 您可以添加圖像、繪圖和文本、簽署文檔等等。 您還可以編輯現有內容。 Apitron PDF Kit .NET 組件可用於跨多個平台創建移動、桌面、Web、Windows 和雲應用程序。

使用此 PDF SDK,您將能夠:

  • 提取、修改和添加圖形(文本、圖像、繪圖)
  • 拆分或合併 PDF 文檔
  • 填寫或創建受密碼保護的 PDF 表單,支持 FDF
  • 創建具有可選內容組(OCG)的多層 PDF 文檔
  • 從文檔中添加或移除字段
  • 使用從右到左或雙向文本創建頁面內容
  • 檢查文檔中的資源——定義的字體、嵌入文件
  • 在 PDF 文檔上進行數字簽名和檢查現有簽名

IronPDF 的主要功能

開發人員,特別是 C# 程序員,會喜歡 IronPDF .NET 庫。 通過這個驚人的工具,您可以輕鬆構建 .NET Core PDF 處理應用程序。

IronPDF 使用 .NET Chromium 引擎將 HTML 頁面(在代碼或 URL 形式中)轉換為 PDF 文件。 完全不需要使用複雜的 API 來排列導航對象或從 HTML 設計 PDF。 IronPDF 支持標準的 Web 文檔,包括 HTML、ASPX、JS、CSS 和圖片。

IronPDF 可以使用 HTML5、CSS、JS 和圖像創建。 PDF 可以輕鬆編輯、加蓋戳記,並添加頁眉和頁腳。 它還使讀取 PDF 文本和提取圖像變得輕鬆。

IronPDF 的突出功能包括:

  • 使用 HTML4/5、CSS 和 JavaScript 建立 PDF 文件
  • 使用自定義網絡登錄憑據、用戶代理、代理、Cookie、HTTP 標頭和表單變量加載 URL(啟用 HTML 登錄表單後登錄)
  • 讀取和完成 PDF 表單字段
  • 從 PDF 中提取文本和圖形
  • 使用新 HTML 內容更新 PDF 頁面
  • 創建基於文本或基於 HTML 的頁眉和頁腳
  • 合併和分離 PDF 文檔內容
  • 將 ASP.NET Web 表單轉換為可打印的 PDF
  • 不需要 Adobe Acrobat 軟體即能打印 PDF 文件

IronPDF 可用於幾乎所有與 C# 兼容的操作系統和框架,包括以下各項:

  • .NET Core 2.1、3.0、3.1、.NET 6 和 5
  • .NET Standard 2.0 通用兼容性
  • Azure、AWS、Docker、Linux、Windows

文章的其餘部分如下:

  1. IronPDF 安裝
  2. Apitron PDF Kit 安裝
  3. 創建 PDF 文檔
  4. 在 PDF 中創建頁眉和頁腳
  5. 數字簽名 PDF
  6. 價格和許可
  7. 結論

1. IronPDF 安裝

下載和安裝 IronPDF 庫有四種方法。 這些方法如下:

  1. 使用 NuGet 套件管理器
  2. 開發者命令提示符
  3. 直接下載 NuGet 套件
  4. 下載 IronPDF .DLL 庫

1.1. 使用 NuGet 套件管理器

要安裝 IronPDF,只需在解決方案資源管理器中右鍵單擊您的項目。 這將打開 NuGet 套件管理器。

class="content-img-align-center"> IronPDF 與 Apitron PDF SDK .NET 的比較 - 圖 1:使用解決方案資源管理器訪問 NuGet 套件管理器

class="content__image-caption">使用解決方案資源管理器訪問 NuGet 套件管理器

一旦選擇,搜尋 IronPDF 套件並安裝它,如下截圖所示。

class="content-img-align-center"> IronPDF 與 Apitron PDF SDK .NET 的比較 - 圖 2:使用 NuGet 套件管理器安裝 IronPDF 庫

class="content__image-caption">使用 NuGet 套件管理器安裝 IronPDF 庫

1.2. 使用開發者命令提示符

您也可以通過開發者命令提示符安裝 IronPDF。

  • 打開 開發者命令提示符——通常在 Visual Studio 文件夾下找到
  • 輸入以下命令:
Install-Package IronPdf
  • 按下 Enter 鍵
  • 這將下載並安裝該套餐
  • 重新加載您的項目並開始使用它

1.3. 直接下載 NuGet 套件

IronPDF 還可以通過直接訪問 IronPDF NuGet 套件 網站並下載套件進行安裝。 步驟是:

  • 瀏覽到 IronPDF NuGet 套件
  • 選擇下載套件
  • 雙擊下載的套件
  • 套件將被安裝
  • 重新加載您的 Visual Studio 項目並開始使用它

IronPDF 已被下載並準備使用。 然而,在此之前,我們應安裝 Apitron PDF 庫。

2. Apitron PDF Kit 安裝

對於 .NET Core 應用,我們可以使用 NuGet 套件管理器安裝 Apitron,或者我們可以從 Apitron PDF Kit NuGet 網站直接下載並安裝 Apitron。

  • 打開 Visual Studio 中的 NuGet 套件,就像我們在 IronPDF 中所做的那樣。
  • 搜尋 Apitron.PDF.Kit。
  • 在當前項目中點擊安裝。
class="content-img-align-center"> IronPDF 與 Apitron PDF SDK .NET 的比較 - 圖 3:Apitron PDF Kit 搜索

class="content__image-caption">Apitron PDF Kit 搜索

您也可以使用 NuGet 套件管理器控制台安裝 Apitron。 按照 IronPDF 中所述的“使用開發者命令提示符”步驟,並輸入以下命令:

Install-Package Apitron.PDF.Kit

按下 ENTER。 它將下載並安裝 Apitron.PDF.Kit。

添加以下命名空間:

using Apitron.PDF.Kit;
using Apitron.PDF.Kit.FixedLayout.Resources;
using Apitron.PDF.Kit.FixedLayout.Resources.Fonts;
using Apitron.PDF.Kit.FlowLayout.Content;
using Apitron.PDF.Kit.Styles;
using Apitron.PDF.Kit.Styles.Appearance;
using Font = Apitron.PDF.Kit.Styles.Text.Font;
using Apitron.PDF.Kit;
using Apitron.PDF.Kit.FixedLayout.Resources;
using Apitron.PDF.Kit.FixedLayout.Resources.Fonts;
using Apitron.PDF.Kit.FlowLayout.Content;
using Apitron.PDF.Kit.Styles;
using Apitron.PDF.Kit.Styles.Appearance;
using Font = Apitron.PDF.Kit.Styles.Text.Font;
Imports Apitron.PDF.Kit
Imports Apitron.PDF.Kit.FixedLayout.Resources
Imports Apitron.PDF.Kit.FixedLayout.Resources.Fonts
Imports Apitron.PDF.Kit.FlowLayout.Content
Imports Apitron.PDF.Kit.Styles
Imports Apitron.PDF.Kit.Styles.Appearance
Imports Font = Apitron.PDF.Kit.Styles.Text.Font
$vbLabelText   $csharpLabel

現在讓我們進入 IronPDF 與 Apitron PDF 之間的比較。

3. 創建 PDF 文檔

3.1. 使用 IronPDF

IronPDF 有多種方法可用來創建 PDF。 讓我們來看看兩個重要的方法。

現有 URL 到 PDF

IronPDF 使將任何 URL 轉換為 PDF 變得容易。 下面的代碼幫助將 URL 轉換為 PDF。

var Renderer = new IronPdf.ChromePdfRenderer();
// Render a PDF from an existing URL
using var Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/");
// Save the PDF to a file
Pdf.SaveAs("url.pdf");
var Renderer = new IronPdf.ChromePdfRenderer();
// Render a PDF from an existing URL
using var Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/");
// Save the PDF to a file
Pdf.SaveAs("url.pdf");
Dim Renderer = New IronPdf.ChromePdfRenderer()
' Render a PDF from an existing URL
Dim Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/")
' Save the PDF to a file
Pdf.SaveAs("url.pdf")
$vbLabelText   $csharpLabel

HTML 輸入字符串到 PDF

下面的代碼說明了如何從 HTML 字符串渲染 PDF 文檔。 您可以僅使用 HTML,或將其與 CSS、圖片和 JavaScript 結合使用。

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

// Load external HTML assets like images, CSS, and JavaScript
// Set the optional BasePath as the file location to load assets from
using var AdvancedPDF = Renderer.RenderHtmlAsPdf("<img src='logo.png'><h1>Sample Text</h1>", @"C:\site\assets\");
AdvancedPDF.SaveAs("html-with-assets.pdf");
var Renderer = new IronPdf.ChromePdfRenderer();
// Render a PDF from a simple HTML string
using var PDF = Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>");
PDF.SaveAs("pixel-perfect.pdf");

// Load external HTML assets like images, CSS, and JavaScript
// Set the optional BasePath as the file location to load assets from
using var AdvancedPDF = Renderer.RenderHtmlAsPdf("<img src='logo.png'><h1>Sample Text</h1>", @"C:\site\assets\");
AdvancedPDF.SaveAs("html-with-assets.pdf");
Dim Renderer = New IronPdf.ChromePdfRenderer()
' Render a PDF from a simple HTML string
Dim PDF = Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>")
PDF.SaveAs("pixel-perfect.pdf")

' Load external HTML assets like images, CSS, and JavaScript
' Set the optional BasePath as the file location to load assets from
Dim AdvancedPDF = Renderer.RenderHtmlAsPdf("<img src='logo.png'><h1>Sample Text</h1>", "C:\site\assets\")
AdvancedPDF.SaveAs("html-with-assets.pdf")
$vbLabelText   $csharpLabel

輸出如下所示:

class="content-img-align-center"> IronPDF 與 Apitron PDF SDK .NET 的比較 - 圖 4:IronPDF 從 URL 和 HTML CSS 字符串生成 PDF

class="content__image-caption">IronPDF 從 URL 和 HTML CSS 字符串生成 PDF

3.2. 使用 Apitron PDF Kit

Apitron PDF 不提供將 URL 或 HTML 轉換為 PDF 的功能。 它允許將 PDF 轉換為 HTML。 但是,它也將 XML 文件轉換為 PDF。 使用的 XML 文件是:

<?xml version="1.0" encoding="utf-8"?>
<FlowDocument xmlns="Apitron.PDF.Kit.FlowLayout.v1">
  <Resources>
    <Image resourceId="logo" fileName="../../images/logo.png" />
  </Resources>
  <Styles>
    <Style selector="flowdocument">
      <Color value="Black" />
    </Style>
    <Style selector="grid">
      <InnerBorder thickness="1" />
      <InnerBorderColor value="Black" />
    </Style>
  </Styles>
  <Elements>
    <Image>
      <Properties>
        <Class value="logo" />
        <ResourceId value="logo" />
      </Properties>
    </Image>
    <TextBlock>
      <Properties>
        <Class value="header" />
        <Text value="Sample Interview Questions for Candidates" />
      </Properties>
    </TextBlock>
    <Br />
    <TextBlock>
      <Properties>
        <Class value="headerNote" />
        <Text value="To help facilitate the interview process, the Human Resources Department has compiled a list of questions that might be used during the phone and/or on-campus interviews. Some of the questions deal with the same content, but are phrased differently while other questions may not pertain to a specific discipline; however all of the questions are unbiased and appropriate to ask. We hope you'll find this helpful." />
      </Properties>
    </TextBlock>
  </Elements>
  <Properties>
    <Margin value="30,20,30,20" />
  </Properties>
</FlowDocument>
<?xml version="1.0" encoding="utf-8"?>
<FlowDocument xmlns="Apitron.PDF.Kit.FlowLayout.v1">
  <Resources>
    <Image resourceId="logo" fileName="../../images/logo.png" />
  </Resources>
  <Styles>
    <Style selector="flowdocument">
      <Color value="Black" />
    </Style>
    <Style selector="grid">
      <InnerBorder thickness="1" />
      <InnerBorderColor value="Black" />
    </Style>
  </Styles>
  <Elements>
    <Image>
      <Properties>
        <Class value="logo" />
        <ResourceId value="logo" />
      </Properties>
    </Image>
    <TextBlock>
      <Properties>
        <Class value="header" />
        <Text value="Sample Interview Questions for Candidates" />
      </Properties>
    </TextBlock>
    <Br />
    <TextBlock>
      <Properties>
        <Class value="headerNote" />
        <Text value="To help facilitate the interview process, the Human Resources Department has compiled a list of questions that might be used during the phone and/or on-campus interviews. Some of the questions deal with the same content, but are phrased differently while other questions may not pertain to a specific discipline; however all of the questions are unbiased and appropriate to ask. We hope you'll find this helpful." />
      </Properties>
    </TextBlock>
  </Elements>
  <Properties>
    <Margin value="30,20,30,20" />
  </Properties>
</FlowDocument>
XML

將此 XML 模板轉換為 PDF 的代碼如下:

// Use Apitron's FlowDocument to convert XML to PDF
using (Stream stream = File.OpenRead("C:\\PLACE YOUR EXACT PATH HERE\\template.xml"), 
               outputStream = File.Create("fromTemplate.pdf"))
{
    ResourceManager resourceManager = new ResourceManager();
    FlowDocument doc = FlowDocument.LoadFromXml(stream, resourceManager);

    doc.Write(outputStream, resourceManager);
}
// Use Apitron's FlowDocument to convert XML to PDF
using (Stream stream = File.OpenRead("C:\\PLACE YOUR EXACT PATH HERE\\template.xml"), 
               outputStream = File.Create("fromTemplate.pdf"))
{
    ResourceManager resourceManager = new ResourceManager();
    FlowDocument doc = FlowDocument.LoadFromXml(stream, resourceManager);

    doc.Write(outputStream, resourceManager);
}
' Use Apitron's FlowDocument to convert XML to PDF
Using stream As Stream = File.OpenRead("C:\PLACE YOUR EXACT PATH HERE\template.xml"), outputStream As Stream = File.Create("fromTemplate.pdf")
	Dim resourceManager As New ResourceManager()
	Dim doc As FlowDocument = FlowDocument.LoadFromXml(stream, resourceManager)

	doc.Write(outputStream, resourceManager)
End Using
$vbLabelText   $csharpLabel

輸出如下所示:

class="content-img-align-center"> IronPDF 與 Apitron PDF SDK .NET 的比較 - 圖 5:Apitron PDF 文檔

class="content__image-caption">Apitron PDF 文檔

如果我們比較 IronPDF 和 Apitron 的輸出,我們可以清晰地看到 IronPDF 使用 HTML 渲染創建令人驚艷的文檔,甚至不縮放圖像大小。另一方面,Apitron 產生與 IronPDF 類似的輸出,但只有在 XML 文件有已註冊的樣式時。

4. 在 PDF 文檔中添加頁眉和頁腳

4.1. 使用 IronPDF

使用 IronPDF 添加頁眉和頁腳相當容易。 IronPDF 允許您添加頁碼和分頁符、附加封面、邊距等。

添加頁眉和頁腳的代碼如下:

var Renderer = new ChromePdfRenderer();

// Add a header
Renderer.RenderingOptions.FirstPageNumber = 1; // Use 2 if a cover page will be appended
Renderer.RenderingOptions.TextHeader.DrawDividerLine = true;
Renderer.RenderingOptions.TextHeader.CenterText = "This is the header text";
Renderer.RenderingOptions.TextHeader.Font = IronPdf.Font.FontTypes.Helvetica;
Renderer.RenderingOptions.TextHeader.FontSize = 12;
Renderer.RenderingOptions.MarginTop = 25; // Create 25mm space for header

// Add a footer too
Renderer.RenderingOptions.TextFooter.DrawDividerLine = true;
Renderer.RenderingOptions.TextFooter.Font = IronPdf.Font.FontTypes.Arial;
Renderer.RenderingOptions.TextFooter.FontSize = 12;
Renderer.RenderingOptions.TextFooter.LeftText = "{date} {time}";
Renderer.RenderingOptions.TextFooter.RightText = "{page} of {total-pages}";
Renderer.RenderingOptions.MarginTop = 25; // Create 25mm space for footer

using var AdvancedPDF = Renderer.RenderHtmlAsPdf("<img src='logo.png'><h1>This is header and footer generated pdf file</h1>", @"C:\site\assets\");
AdvancedPDF.SaveAs("html-with-assets.pdf");
var Renderer = new ChromePdfRenderer();

// Add a header
Renderer.RenderingOptions.FirstPageNumber = 1; // Use 2 if a cover page will be appended
Renderer.RenderingOptions.TextHeader.DrawDividerLine = true;
Renderer.RenderingOptions.TextHeader.CenterText = "This is the header text";
Renderer.RenderingOptions.TextHeader.Font = IronPdf.Font.FontTypes.Helvetica;
Renderer.RenderingOptions.TextHeader.FontSize = 12;
Renderer.RenderingOptions.MarginTop = 25; // Create 25mm space for header

// Add a footer too
Renderer.RenderingOptions.TextFooter.DrawDividerLine = true;
Renderer.RenderingOptions.TextFooter.Font = IronPdf.Font.FontTypes.Arial;
Renderer.RenderingOptions.TextFooter.FontSize = 12;
Renderer.RenderingOptions.TextFooter.LeftText = "{date} {time}";
Renderer.RenderingOptions.TextFooter.RightText = "{page} of {total-pages}";
Renderer.RenderingOptions.MarginTop = 25; // Create 25mm space for footer

using var AdvancedPDF = Renderer.RenderHtmlAsPdf("<img src='logo.png'><h1>This is header and footer generated pdf file</h1>", @"C:\site\assets\");
AdvancedPDF.SaveAs("html-with-assets.pdf");
Dim Renderer = New ChromePdfRenderer()

' Add a header
Renderer.RenderingOptions.FirstPageNumber = 1 ' Use 2 if a cover page will be appended
Renderer.RenderingOptions.TextHeader.DrawDividerLine = True
Renderer.RenderingOptions.TextHeader.CenterText = "This is the header text"
Renderer.RenderingOptions.TextHeader.Font = IronPdf.Font.FontTypes.Helvetica
Renderer.RenderingOptions.TextHeader.FontSize = 12
Renderer.RenderingOptions.MarginTop = 25 ' Create 25mm space for header

' Add a footer too
Renderer.RenderingOptions.TextFooter.DrawDividerLine = True
Renderer.RenderingOptions.TextFooter.Font = IronPdf.Font.FontTypes.Arial
Renderer.RenderingOptions.TextFooter.FontSize = 12
Renderer.RenderingOptions.TextFooter.LeftText = "{date} {time}"
Renderer.RenderingOptions.TextFooter.RightText = "{page} of {total-pages}"
Renderer.RenderingOptions.MarginTop = 25 ' Create 25mm space for footer

Dim AdvancedPDF = Renderer.RenderHtmlAsPdf("<img src='logo.png'><h1>This is header and footer generated pdf file</h1>", "C:\site\assets\")
AdvancedPDF.SaveAs("html-with-assets.pdf")
$vbLabelText   $csharpLabel

輸出如下所示:

class="content-img-align-center"> IronPDF 與 Apitron PDF SDK .NET 的比較 - 圖 6:IronPDF 頁眉和頁腳

class="content__image-caption">IronPDF 頁眉和頁腳

4.2. 使用 Apitron PDF Kit

Apitron PDF Kit 通過將内容轉換為 XML 結構格式為 PDF 創建 PDF。 在 Apitron PDF Kit 中,可以使用 PageHeaderPageFooter 屬性添加頁眉和頁腳。 實現此功能的代碼如下:

// Register document resources first
ResourceManager resourceManager = new ResourceManager();
resourceManager.RegisterResource(new Apitron.PDF.Kit.FixedLayout.Resources.XObjects.Image("logo", "../../data/logo.png"));

// Create the document
FlowDocument doc = new FlowDocument() { Margin = new Thickness(10) };

// Register styles
doc.StyleManager.RegisterStyle(".pageHeader", new Style() { Font = new Font(StandardFonts.TimesBold, 20) });
doc.StyleManager.RegisterStyle(".pageFooter", new Style() { Align = Align.Right });
doc.StyleManager.RegisterStyle("hr", new Style() { Height = 2, Margin = new Thickness(0, 5, 0, 5) });
doc.StyleManager.RegisterStyle(".content", new Style() { Align = Align.Left, Display = Display.InlineBlock });

// Fill the header section
doc.PageHeader.Class = "pageHeader";
doc.PageHeader.Add(new Image("logo") { Width = 100, Height = 50 });
doc.PageHeader.Add(new TextBlock("This document is intended for internal use only") { TextIndent = 20 });
doc.PageHeader.Add(new Hr());

// Fill the footer section
doc.PageFooter.Class = "pageFooter";
doc.PageFooter.Add(new Hr());
doc.PageFooter.Add(new TextBlock((ctx) => string.Format("Page {0} from&nbsp;", ctx.CurrentPage + 1)));
doc.PageFooter.Add(new PageCount(3) { Display = Display.Inline });

// Add pages
for (int i = 0; i < 2; ++i)
{
    doc.Add(new TextBlock("This is header and footer generation pdf file.") { Class = "content" });
    doc.Add(new PageBreak());
}

// Generate PDF
using (Stream stream = File.Create("out.pdf"))
{
    doc.Write(stream, resourceManager);
}

Process.Start("out.pdf");
// Register document resources first
ResourceManager resourceManager = new ResourceManager();
resourceManager.RegisterResource(new Apitron.PDF.Kit.FixedLayout.Resources.XObjects.Image("logo", "../../data/logo.png"));

// Create the document
FlowDocument doc = new FlowDocument() { Margin = new Thickness(10) };

// Register styles
doc.StyleManager.RegisterStyle(".pageHeader", new Style() { Font = new Font(StandardFonts.TimesBold, 20) });
doc.StyleManager.RegisterStyle(".pageFooter", new Style() { Align = Align.Right });
doc.StyleManager.RegisterStyle("hr", new Style() { Height = 2, Margin = new Thickness(0, 5, 0, 5) });
doc.StyleManager.RegisterStyle(".content", new Style() { Align = Align.Left, Display = Display.InlineBlock });

// Fill the header section
doc.PageHeader.Class = "pageHeader";
doc.PageHeader.Add(new Image("logo") { Width = 100, Height = 50 });
doc.PageHeader.Add(new TextBlock("This document is intended for internal use only") { TextIndent = 20 });
doc.PageHeader.Add(new Hr());

// Fill the footer section
doc.PageFooter.Class = "pageFooter";
doc.PageFooter.Add(new Hr());
doc.PageFooter.Add(new TextBlock((ctx) => string.Format("Page {0} from&nbsp;", ctx.CurrentPage + 1)));
doc.PageFooter.Add(new PageCount(3) { Display = Display.Inline });

// Add pages
for (int i = 0; i < 2; ++i)
{
    doc.Add(new TextBlock("This is header and footer generation pdf file.") { Class = "content" });
    doc.Add(new PageBreak());
}

// Generate PDF
using (Stream stream = File.Create("out.pdf"))
{
    doc.Write(stream, resourceManager);
}

Process.Start("out.pdf");
' Register document resources first
Dim resourceManager As New ResourceManager()
resourceManager.RegisterResource(New Apitron.PDF.Kit.FixedLayout.Resources.XObjects.Image("logo", "../../data/logo.png"))

' Create the document
Dim doc As New FlowDocument() With {.Margin = New Thickness(10)}

' Register styles
doc.StyleManager.RegisterStyle(".pageHeader", New Style() With {.Font = New Font(StandardFonts.TimesBold, 20)})
doc.StyleManager.RegisterStyle(".pageFooter", New Style() With {.Align = Align.Right})
doc.StyleManager.RegisterStyle("hr", New Style() With {
	.Height = 2,
	.Margin = New Thickness(0, 5, 0, 5)
})
doc.StyleManager.RegisterStyle(".content", New Style() With {
	.Align = Align.Left,
	.Display = Display.InlineBlock
})

' Fill the header section
doc.PageHeader.Class = "pageHeader"
doc.PageHeader.Add(New Image("logo") With {
	.Width = 100,
	.Height = 50
})
doc.PageHeader.Add(New TextBlock("This document is intended for internal use only") With {.TextIndent = 20})
doc.PageHeader.Add(New Hr())

' Fill the footer section
doc.PageFooter.Class = "pageFooter"
doc.PageFooter.Add(New Hr())
doc.PageFooter.Add(New TextBlock(Function(ctx) String.Format("Page {0} from&nbsp;", ctx.CurrentPage + 1)))
doc.PageFooter.Add(New PageCount(3) With {.Display = Display.Inline})

' Add pages
For i As Integer = 0 To 1
	doc.Add(New TextBlock("This is header and footer generation pdf file.") With {.Class = "content"})
	doc.Add(New PageBreak())
Next i

' Generate PDF
Using stream As Stream = File.Create("out.pdf")
	doc.Write(stream, resourceManager)
End Using

Process.Start("out.pdf")
$vbLabelText   $csharpLabel

輸出如下所示:

class="content-img-align-center"> IronPDF 與 Apitron PDF SDK .NET 的比較 - 圖 7:Apitron 頁眉和頁腳

class="content__image-caption">Apitron 頁眉和頁腳

5. 數字簽名 PDF

5.1. 使用 IronPDF

數字簽名 PDF 文檔是 PDF 處理的最重要功能之一。 IronPDF 提供完成此操作的所有工具。

using IronPdf;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

5.2 使用 Apitron PDF Kit

使用 Apitron PDF Kit 签章一个 PDF 是一个既繁琐又技术性的过程。

static void Main(string[] args)
{
    string fileName = "signedTwice.pdf";

    using (Stream stream = File.Create(fileName))
    {
        FlowDocument doc = new FlowDocument() { Margin = new Thickness(10) };
        doc.Add(new TextBlock("Signed using Apitron PDF Kit for .NET"));
        doc.Write(stream, new ResourceManager());
    }

    // Save
    Sign(fileName, "../../data/certs/JohnDoe.pfx", "password", "../../data/images/signatureImage.png", new Boundary(10, 750, 110, 800));
}

// Implementation of Sign Method
private static void Sign(string pathToDocument, string pathToCertificate, string password, string pathToSignatureImage, Boundary signatureViewLocation)
{
    // Open existing document and sign once
    using (Stream inputStream = new FileStream(pathToDocument, FileMode.Open, FileAccess.ReadWrite))
    {
        using (FixedDocument doc = new FixedDocument(inputStream))
        {
            string imageResourceId = Guid.NewGuid().ToString("N");
            string signatureFieldId = Guid.NewGuid().ToString("N");

            // Register signature image resource
            doc.ResourceManager.RegisterResource(new Image(imageResourceId, pathToSignatureImage));

            // Create first signature field and initialize it using a stored certificate
            SignatureField signatureField = new SignatureField(signatureFieldId);
            using (Stream signatureDataStream = File.OpenRead(pathToCertificate))
            {
                signatureField.Signature = Signature.Create(new Pkcs12Store(signatureDataStream, password));
            }

            // Add signature fields to the document
            doc.AcroForm.Fields.Add(signatureField);

            // Create first signature view using the image resource
            SignatureFieldView signatureView = new SignatureFieldView(signatureField, signatureViewLocation);
            signatureView.ViewSettings.Graphic = Graphic.Image;
            signatureView.ViewSettings.GraphicResourceID = imageResourceId;
            signatureView.ViewSettings.Description = Description.None;

            // Add views to page annotations collection
            doc.Pages[0].Annotations.Add(signatureView);

            // Save as incremental update
            doc.Save();
        }
    }
}
static void Main(string[] args)
{
    string fileName = "signedTwice.pdf";

    using (Stream stream = File.Create(fileName))
    {
        FlowDocument doc = new FlowDocument() { Margin = new Thickness(10) };
        doc.Add(new TextBlock("Signed using Apitron PDF Kit for .NET"));
        doc.Write(stream, new ResourceManager());
    }

    // Save
    Sign(fileName, "../../data/certs/JohnDoe.pfx", "password", "../../data/images/signatureImage.png", new Boundary(10, 750, 110, 800));
}

// Implementation of Sign Method
private static void Sign(string pathToDocument, string pathToCertificate, string password, string pathToSignatureImage, Boundary signatureViewLocation)
{
    // Open existing document and sign once
    using (Stream inputStream = new FileStream(pathToDocument, FileMode.Open, FileAccess.ReadWrite))
    {
        using (FixedDocument doc = new FixedDocument(inputStream))
        {
            string imageResourceId = Guid.NewGuid().ToString("N");
            string signatureFieldId = Guid.NewGuid().ToString("N");

            // Register signature image resource
            doc.ResourceManager.RegisterResource(new Image(imageResourceId, pathToSignatureImage));

            // Create first signature field and initialize it using a stored certificate
            SignatureField signatureField = new SignatureField(signatureFieldId);
            using (Stream signatureDataStream = File.OpenRead(pathToCertificate))
            {
                signatureField.Signature = Signature.Create(new Pkcs12Store(signatureDataStream, password));
            }

            // Add signature fields to the document
            doc.AcroForm.Fields.Add(signatureField);

            // Create first signature view using the image resource
            SignatureFieldView signatureView = new SignatureFieldView(signatureField, signatureViewLocation);
            signatureView.ViewSettings.Graphic = Graphic.Image;
            signatureView.ViewSettings.GraphicResourceID = imageResourceId;
            signatureView.ViewSettings.Description = Description.None;

            // Add views to page annotations collection
            doc.Pages[0].Annotations.Add(signatureView);

            // Save as incremental update
            doc.Save();
        }
    }
}
Shared Sub Main(ByVal args() As String)
	Dim fileName As String = "signedTwice.pdf"

	Using stream As Stream = File.Create(fileName)
		Dim doc As New FlowDocument() With {.Margin = New Thickness(10)}
		doc.Add(New TextBlock("Signed using Apitron PDF Kit for .NET"))
		doc.Write(stream, New ResourceManager())
	End Using

	' Save
	Sign(fileName, "../../data/certs/JohnDoe.pfx", "password", "../../data/images/signatureImage.png", New Boundary(10, 750, 110, 800))
End Sub

' Implementation of Sign Method
Private Shared Sub Sign(ByVal pathToDocument As String, ByVal pathToCertificate As String, ByVal password As String, ByVal pathToSignatureImage As String, ByVal signatureViewLocation As Boundary)
	' Open existing document and sign once
	Using inputStream As Stream = New FileStream(pathToDocument, FileMode.Open, FileAccess.ReadWrite)
		Using doc As New FixedDocument(inputStream)
			Dim imageResourceId As String = Guid.NewGuid().ToString("N")
			Dim signatureFieldId As String = Guid.NewGuid().ToString("N")

			' Register signature image resource
			doc.ResourceManager.RegisterResource(New Image(imageResourceId, pathToSignatureImage))

			' Create first signature field and initialize it using a stored certificate
			Dim signatureField As New SignatureField(signatureFieldId)
			Using signatureDataStream As Stream = File.OpenRead(pathToCertificate)
				signatureField.Signature = Signature.Create(New Pkcs12Store(signatureDataStream, password))
			End Using

			' Add signature fields to the document
			doc.AcroForm.Fields.Add(signatureField)

			' Create first signature view using the image resource
			Dim signatureView As New SignatureFieldView(signatureField, signatureViewLocation)
			signatureView.ViewSettings.Graphic = Graphic.Image
			signatureView.ViewSettings.GraphicResourceID = imageResourceId
			signatureView.ViewSettings.Description = Description.None

			' Add views to page annotations collection
			doc.Pages(0).Annotations.Add(signatureView)

			' Save as incremental update
			doc.Save()
		End Using
	End Using
End Sub
$vbLabelText   $csharpLabel

这些库的输出基本相同。 你可以清楚地看到,IronPDF 比操控 PDF 内容更简单更方便。 輸出 PDF 用證書和簽名印刷。

使用 IronPDF 的 Bootstrap 5 做個人作品集

IronPDF 的 Chrome V8 渲染引擎全力支持现代 Bootstrap 5 组件,使您能够利用专业作品集生成视觉震撼的 PDF 文档。 这个例子演示了网格布局、悬停效果、渐变覆盖和类别标记 - 传统PDF库如 Apitron PDF SDK 難以实现的功能。

using IronPdf;

var renderer = new ChromePdfRenderer();

string portfolioGallery = @"
<!DOCTYPE html>
<html>
<head>
    <meta charset='utf-8'>
    <link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css' rel='stylesheet'>
    <style>
        .gallery-item {
            position: relative;
            overflow: hidden;
            border-radius: 10px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }
        .gallery-item img {
            width: 100%;
            height: 250px;
            object-fit: cover;
            transition: transform 0.3s;
        }
        .gallery-item:hover img {
            transform: scale(1.1);
        }
        .gallery-overlay {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
            padding: 20px;
            color: white;
        }
        .category-badge {
            position: absolute;
            top: 10px;
            right: 10px;
        }
        @media print {
            .gallery-item { page-break-inside: avoid; }
        }
    </style>
</head>
<body>
    <div class='container py-5'>
        <div class='text-center mb-5'>
            <h1 class='display-4'>Design Portfolio</h1>
            <p class='lead text-muted'>Showcase of PDF Document Designs</p>
        </div>

        <div class='row mb-4'>
            <div class='col-12'>
                <div class='btn-group' role='group'>
                    <button class='btn btn-primary'>All Projects</button>
                    <button class='btn btn-outline-primary'>Invoices</button>
                    <button class='btn btn-outline-primary'>Reports</button>
                    <button class='btn btn-outline-primary'>Forms</button>
                    <button class='btn btn-outline-primary'>Certificates</button>
                </div>
            </div>
        </div>

        <div class='row g-4'>
            <div class='col-md-4'>
                <div class='gallery-item'>
                    <span class='badge bg-primary category-badge'>Invoice</span>
                    <svg width='100%' height='250' style='background: linear-gradient(135deg, #667eea 0%, #764ba2 100%)'>
                        <text x='50%' y='50%' text-anchor='middle' fill='white' font-size='48' opacity='0.3'>📄</text>
                    </svg>
                    <div class='gallery-overlay'>
                        <h5 class='mb-1'>Professional Invoice Template</h5>
                        <small>Corporate billing with itemized details</small>
                    </div>
                </div>
            </div>

            <div class='col-md-4'>
                <div class='gallery-item'>
                    <span class='badge bg-success category-badge'>Report</span>
                    <svg width='100%' height='250' style='background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%)'>
                        <text x='50%' y='50%' text-anchor='middle' fill='white' font-size='48' opacity='0.3'>📊</text>
                    </svg>
                    <div class='gallery-overlay'>
                        <h5 class='mb-1'>Analytics Dashboard Report</h5>
                        <small>Data visualization and metrics</small>
                    </div>
                </div>
            </div>

            <div class='col-md-4'>
                <div class='gallery-item'>
                    <span class='badge bg-warning category-badge'>Certificate</span>
                    <svg width='100%' height='250' style='background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)'>
                        <text x='50%' y='50%' text-anchor='middle' fill='white' font-size='48' opacity='0.3'>🏆</text>
                    </svg>
                    <div class='gallery-overlay'>
                        <h5 class='mb-1'>Award Certificate</h5>
                        <small>Professional achievement recognition</small>
                    </div>
                </div>
            </div>

            <div class='col-md-4'>
                <div class='gallery-item'>
                    <span class='badge bg-info category-badge'>Form</span>
                    <svg width='100%' height='250' style='background: linear-gradient(135deg, #fa709a 0%, #fee140 100%)'>
                        <text x='50%' y='50%' text-anchor='middle' fill='white' font-size='48' opacity='0.3'>📝</text>
                    </svg>
                    <div class='gallery-overlay'>
                        <h5 class='mb-1'>Application Form</h5>
                        <small>Multi-page data collection</small>
                    </div>
                </div>
            </div>

            <div class='col-md-4'>
                <div class='gallery-item'>
                    <span class='badge bg-danger category-badge'>Invoice</span>
                    <svg width='100%' height='250' style='background: linear-gradient(135deg, #30cfd0 0%, #330867 100%)'>
                        <text x='50%' y='50%' text-anchor='middle' fill='white' font-size='48' opacity='0.3'>💰</text>
                    </svg>
                    <div class='gallery-overlay'>
                        <h5 class='mb-1'>Payment Receipt</h5>
                        <small>Transaction confirmation document</small>
                    </div>
                </div>
            </div>

            <div class='col-md-4'>
                <div class='gallery-item'>
                    <span class='badge bg-secondary category-badge'>Report</span>
                    <svg width='100%' height='250' style='background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%)'>
                        <text x='50%' y='50%' text-anchor='middle' fill='white' font-size='48' opacity='0.3'>📈</text>
                    </svg>
                    <div class='gallery-overlay'>
                        <h5 class='mb-1'>Financial Statement</h5>
                        <small>Quarterly performance overview</small>
                    </div>
                </div>
            </div>
        </div>

        <div class='text-center mt-5'>
            <p class='text-muted'>All templates rendered with IronPDF's Chromium engine</p>
            <div class='d-flex justify-content-center gap-2'>
                <span class='badge bg-primary'>Bootstrap 5</span>
                <span class='badge bg-success'>Responsive</span>
                <span class='badge bg-info'>Print-Ready</span>
            </div>
        </div>
    </div>
</body>
</html>";

var pdf = renderer.RenderHtmlAsPdf(portfolioGallery);
pdf.SaveAs("portfolio-gallery.pdf");
using IronPdf;

var renderer = new ChromePdfRenderer();

string portfolioGallery = @"
<!DOCTYPE html>
<html>
<head>
    <meta charset='utf-8'>
    <link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css' rel='stylesheet'>
    <style>
        .gallery-item {
            position: relative;
            overflow: hidden;
            border-radius: 10px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }
        .gallery-item img {
            width: 100%;
            height: 250px;
            object-fit: cover;
            transition: transform 0.3s;
        }
        .gallery-item:hover img {
            transform: scale(1.1);
        }
        .gallery-overlay {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
            padding: 20px;
            color: white;
        }
        .category-badge {
            position: absolute;
            top: 10px;
            right: 10px;
        }
        @media print {
            .gallery-item { page-break-inside: avoid; }
        }
    </style>
</head>
<body>
    <div class='container py-5'>
        <div class='text-center mb-5'>
            <h1 class='display-4'>Design Portfolio</h1>
            <p class='lead text-muted'>Showcase of PDF Document Designs</p>
        </div>

        <div class='row mb-4'>
            <div class='col-12'>
                <div class='btn-group' role='group'>
                    <button class='btn btn-primary'>All Projects</button>
                    <button class='btn btn-outline-primary'>Invoices</button>
                    <button class='btn btn-outline-primary'>Reports</button>
                    <button class='btn btn-outline-primary'>Forms</button>
                    <button class='btn btn-outline-primary'>Certificates</button>
                </div>
            </div>
        </div>

        <div class='row g-4'>
            <div class='col-md-4'>
                <div class='gallery-item'>
                    <span class='badge bg-primary category-badge'>Invoice</span>
                    <svg width='100%' height='250' style='background: linear-gradient(135deg, #667eea 0%, #764ba2 100%)'>
                        <text x='50%' y='50%' text-anchor='middle' fill='white' font-size='48' opacity='0.3'>📄</text>
                    </svg>
                    <div class='gallery-overlay'>
                        <h5 class='mb-1'>Professional Invoice Template</h5>
                        <small>Corporate billing with itemized details</small>
                    </div>
                </div>
            </div>

            <div class='col-md-4'>
                <div class='gallery-item'>
                    <span class='badge bg-success category-badge'>Report</span>
                    <svg width='100%' height='250' style='background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%)'>
                        <text x='50%' y='50%' text-anchor='middle' fill='white' font-size='48' opacity='0.3'>📊</text>
                    </svg>
                    <div class='gallery-overlay'>
                        <h5 class='mb-1'>Analytics Dashboard Report</h5>
                        <small>Data visualization and metrics</small>
                    </div>
                </div>
            </div>

            <div class='col-md-4'>
                <div class='gallery-item'>
                    <span class='badge bg-warning category-badge'>Certificate</span>
                    <svg width='100%' height='250' style='background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)'>
                        <text x='50%' y='50%' text-anchor='middle' fill='white' font-size='48' opacity='0.3'>🏆</text>
                    </svg>
                    <div class='gallery-overlay'>
                        <h5 class='mb-1'>Award Certificate</h5>
                        <small>Professional achievement recognition</small>
                    </div>
                </div>
            </div>

            <div class='col-md-4'>
                <div class='gallery-item'>
                    <span class='badge bg-info category-badge'>Form</span>
                    <svg width='100%' height='250' style='background: linear-gradient(135deg, #fa709a 0%, #fee140 100%)'>
                        <text x='50%' y='50%' text-anchor='middle' fill='white' font-size='48' opacity='0.3'>📝</text>
                    </svg>
                    <div class='gallery-overlay'>
                        <h5 class='mb-1'>Application Form</h5>
                        <small>Multi-page data collection</small>
                    </div>
                </div>
            </div>

            <div class='col-md-4'>
                <div class='gallery-item'>
                    <span class='badge bg-danger category-badge'>Invoice</span>
                    <svg width='100%' height='250' style='background: linear-gradient(135deg, #30cfd0 0%, #330867 100%)'>
                        <text x='50%' y='50%' text-anchor='middle' fill='white' font-size='48' opacity='0.3'>💰</text>
                    </svg>
                    <div class='gallery-overlay'>
                        <h5 class='mb-1'>Payment Receipt</h5>
                        <small>Transaction confirmation document</small>
                    </div>
                </div>
            </div>

            <div class='col-md-4'>
                <div class='gallery-item'>
                    <span class='badge bg-secondary category-badge'>Report</span>
                    <svg width='100%' height='250' style='background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%)'>
                        <text x='50%' y='50%' text-anchor='middle' fill='white' font-size='48' opacity='0.3'>📈</text>
                    </svg>
                    <div class='gallery-overlay'>
                        <h5 class='mb-1'>Financial Statement</h5>
                        <small>Quarterly performance overview</small>
                    </div>
                </div>
            </div>
        </div>

        <div class='text-center mt-5'>
            <p class='text-muted'>All templates rendered with IronPDF's Chromium engine</p>
            <div class='d-flex justify-content-center gap-2'>
                <span class='badge bg-primary'>Bootstrap 5</span>
                <span class='badge bg-success'>Responsive</span>
                <span class='badge bg-info'>Print-Ready</span>
            </div>
        </div>
    </div>
</body>
</html>";

var pdf = renderer.RenderHtmlAsPdf(portfolioGallery);
pdf.SaveAs("portfolio-gallery.pdf");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

此代码生成专业的 PDF 作品集,其中包括响应式网格布局、视觉类目标记、渐变覆盖和悬停效果。 Chrome 渲染引擎保留了所有 Bootstrap 样式、CSS Grid 布局和自定义 CSS 属性——传统 PDF 库难以再现的能力。

与 Apitron PDF SDK 的关键优势:

  • 原生支持 Bootstrap 5,无需转换
  • CSS Grid 和 Flexbox 布局完美渲染
  • 漸變背景和現代 CSS 效果
  • 更简单的代码和更高质量的输出

有关 Bootstrap PDF 生成的完整指南,请参阅HTML 到 PDF Bootstrap 指南

6. 價格和許可

IronPDF定價和許可

IronPDF 是一个开发时免費使用的 C# 库,可以隨時獲得商用許可。项目许可适用于单个开发者、代理商和跨国机构,以及 SaaS 和 OEM 重新分配。 所有许可均提供 30 天退款保证、一年支持與升級、開發/測試/生產有效性,以及永久許可(一次性購買)。

Lite 套裝可用於$799,無需經常性支出。 有關挑選最佳許可的詳細信息和協助,請瀏覽 IronPDF 产品许可页面

class="content-img-align-center"> IronPDF 與 Apitron PDF SDK .NET 的比較 - 圖 8:IronPDF 許可

class="content__image-caption">IronPDF 許可

Apitron PDF Kit 價格和許可

目前有兩種許可方案——現代和遺留。 如果您已經擁有許可證,那麼原有許可方案將對您保持生效直到許可期滿。 在此之後,您需要聯繫客戶支持以轉換。 現代許可方案僅適用於新客戶。

按照現代方案,有三個許可級別:

  • 評估——三個月評估期以使用全功能產品。 只需從 NuGet 下載套件並開始開發。
  • 社區——在非商業項目中免費使用全功能產品。 需要批准。
  • 商業——任何沒有定性在上面描述的使用情況。 價格取決於使用模式。

結論

IronPDF 庫創建像素完美的來自於 HTML、JS、CSS、JPG、PNG、GIF 和 SVG 等文檔類型的 PDF。 Chromium 引擎有助於渲染 HTML 文件或 URL,以生成完美的 PDF 作為輸出。

Apitron 可讓您使用固定佈局 API創建 PDF,它的實現與 PDF 規範 100% 兼容。 作為一種類似於 HTML 和 CSS 的以樣式驅動的內容生成方法,這個固定佈局 API 使您能夠在數分鐘內創建令人驚嘆的報告、賬單、目錄等。 也支持創建 XML 模板。

Apitron PDF 的許可價格在其網站上不可用。您需要與支持聯繫並根據您的使用獲取報價。 另一個方面,IronPDF 擁有非常清晰的許可套件顯示在其網站上。這使得 IronPDF 在其競爭對手中脫穎而出,並允許用戶根據自己的需求明智選擇。

使用 IronPDF,您可以比 Apitron PDF 更輕鬆地處理 PDF 文件。 IronPDF 允許其用戶用較少的代碼行來執行複雜的 PDF 工作。 IronPDF 提供多種方法來從多個文件類型生成 PDF,而 Apitron 只能轉換 XML 文件到 PDF 文檔。 與 Apitron 相比,不需要在 IronPDF 中添加任何技術選項即可獲得完美的輸出。

所有 Iron Software 的客戶可以選購公司五款產品中的任何三款的價格。 尝试 IronPDF 免费的 30 天试用版来测试其完整功能。 购买 Iron Software 产品的整套在 IronSoftware.com网站上。

請注意Apitron PDF Kit 是其相應擁有者的註冊商標。 此站點與 Apitron PDF Kit 無關,也未經其認可或贊助。 所有產品名稱、徽標和品牌均為其各自所有者的財產。 比較僅供信息參考,並反映撰寫時公開可用的信息。

常見問題解答

如何在 C# 中將 HTML 轉換為 PDF?

您可以使用 IronPDF 的 RenderHtmlAsPdf 方法將 HTML 字符串轉換為 PDF。您還可以使用 RenderHtmlFileAsPdf 將 HTML 文件轉換為 PDF。

IronPDF 為 PDF 創建提供什麼功能?

IronPDF 支援從 HTML、CSS 和 JavaScript 創建 PDF,載入 URL,提取文本和圖形,合併 PDF 等。它與 .NET Core、Azure、AWS、Docker、Linux 和 Windows 兼容。

如何在 C# 中以數位方式簽署 PDF?

使用 IronPDF,您可以使用 PDF 簽名證書來以數位方式簽署 PDF,只需幾行代碼即可集成。

IronPDF 的安裝選項有哪些?

IronPDF 可使用 NuGet 套件管理器、開發者命令提示符安裝,或直接下載 NuGet 套件或 IronPDF .DLL 庫進行安裝。

IronPDF 是否有免費版本?

是的,IronPDF 提供免費的開發版本以及商業許可證。詳細的定價資訊,包括 30 天退款保證,可在其網站上查詢。

Apitron PDF Kit 怎麼進行 HTML 到 PDF 的轉換?

Apitron PDF Kit 不支援直接 HTML 到 PDF 的轉換,但可以將 XML 文件轉換為 PDF。

Apitron PDF Kit 的突出功能有哪些?

Apitron PDF Kit 可以全面操作 PDF,包括添加圖像、圖形、文本、簽署文件,合併或拆分 PDF。然而,它缺乏直接的 HTML 到 PDF 轉換功能。

如何在 C# 中向 PDF 添加頁眉和頁腳?

IronPDF 使您可以使用 AddTextHeaderAddTextFooter 等方法輕鬆地向 PDF 添加頁眉和頁腳。

Apitron PDF Kit 提供哪些許可證選項?

Apitron PDF Kit 提供三個月的評估期和非商業專案的社區許可證。對於商業用途,您需要直接聯繫他們以獲取報價。

哪個 PDF 庫對 .NET 開發更容易使用?

IronPDF 一般來說更容易用於 .NET 開發,提供更簡單明瞭的 API,並且需要的代碼行數較少,適合於複雜任務,而 Apitron PDF Kit 則較繁瑣。

Curtis Chau
技術作家

Curtis Chau 擁有卡爾頓大學計算機科學學士學位,專注於前端開發,擅長於 Node.js、TypeScript、JavaScript 和 React。Curtis 熱衷於創建直觀且美觀的用戶界面,喜歡使用現代框架並打造結構良好、視覺吸引人的手冊。

除了開發之外,Curtis 對物聯網 (IoT) 有著濃厚的興趣,探索將硬體和軟體結合的創新方式。在閒暇時間,他喜愛遊戲並構建 Discord 機器人,結合科技與創意的樂趣。