如何在 Docker 中使用 IronPDF 引擎 | IronPDF
2025年5月27日,Apryse收購了TallComponents。 不再提供TallPDF.NET和PDFKit.NET的新授權,Apryse將新買家引導至iText SDK(亦由Apryse擁有)。 現有客戶繼續獲得支援,但引擎僅限於維護。 目前使用TallComponents的團隊,現在規劃遷移以避免日後強制轉換。
本指南提供從TallComponents遷移到IronPDF的路徑,包括.NET開發者計劃過渡的逐步指導、API映射和程式碼範例。
為何規劃TallComponents遷移
TallComponents(創立於2001年)發行了兩個主要的.NET PDF產品:用於載入和處理PDF的PDFKit.NET,以及用於面向佈局的文件生成的TallPDF.NET。 在Apryse收購後,新的授權銷售已結束,這改變了依賴於該程式庫的團隊的規劃前景。
當前TallComponents的主要限制
新授權已關閉: Apryse的TallComponents頁面指出不再提供TallComponents產品的新授權,並引導新買家使用iText SDK。 仍然支援現有的授權持有人。
僅限XHTML的HTML管道: TallPDF.NET包含一個XhtmlParagraph類來解析XHTML 1.0 Strict / XHTML 1.1 + CSS 2.1。PDFKit.NET自身沒有HTML管道。現代HTML5 + CSS3 + JavaScript內容並不可靠渲染——盒子中沒有無頭瀏覽器引擎。
凍結的平台目標: TallComponents.PDFKit5目標.NET Standard 2.0; 舊的TallComponents.PDFKit(4.x)針對.NET Framework 2.0。沒有公佈.NET 8/9的TFM。
僅限於維護的路徑: 由於Apryse的開發精力專注於Apryse SDK和iText,TallComponents品牌的包僅收到維護更新,沒有新的功能路徑。
IronPDF:現代的TallComponents替代方案
IronPDF解決了影響當前.NET堆棧上TallComponents使用者的核心缺口:
| 功能 | TallComponents | IronPDF |
|---|---|---|
| 當前銷售狀態 | 新授權已關閉(Apryse於2025-05-27收購) | 積極銷售 |
| HTML-to-PDF支援 | XHTML 1.0/1.1 + CSS 2.1透過XhtmlParagraph(TallPDF.NET) |
是(HTML5/CSS3與Chromium) |
| HTML中的JavaScript | 否 | 完整的ES2024 |
| 安裝 | NuGet(TallComponents.TallPDF5) |
NuGet(IronPdf) |
| 客戶支援 | 僅限現有客戶; 新買家引導至iText | 積極支援與社群 |
| 未來投資 | 僅限於維護 | 長期路徑 |
TallComponents使用根植於較早的.NET文件生成時代的XML/佈局導向模型,而IronPDF提供符合當今團隊建置前端應用的Chromium驅動的HTML渲染。
快速開始:從TallComponents遷移至IronPDF
步驟 1:替換 NuGet 套件
移除專案參考的TallComponents套件。 nuget.org上的真實套件ID是TallComponents.TallPDF5 / TallPDF6:
# RemoveTallComponentspackages (whichever your project uses)
dotnet remove package TallComponents.PDFKit5
dotnet remove package TallComponents.TallPDF5
dotnet remove package TallComponents.PDFRasterizer4
# RemoveTallComponentspackages (whichever your project uses)
dotnet remove package TallComponents.PDFKit5
dotnet remove package TallComponents.TallPDF5
dotnet remove package TallComponents.PDFRasterizer4
安裝 IronPDF:
dotnet add package IronPdf
對於專用框架,IronPDF提供專門的擴充套件包:
Blazor Server:
Install-Package IronPdf.Extensions.Blazor
MAUI:
Install-Package IronPdf.Extensions.Maui
MVC Framework:
Install-Package IronPdf.Extensions.Mvc.Framework
步驟 2:更新命名空間
將TallComponents命名空間替換為IronPDF命名空間:
// Before (TallComponents — real namespaces)
using TallComponents.PDF; // Document, Page (PDFKit.NET)
using TallComponents.PDF.Shapes; // TextShape, ImageShape (PDFKit)
using TallComponents.PDF.Security; // PasswordSecurity
using TallComponents.PDF.Layout; // Document, Section (TallPDF.NET)
using TallComponents.PDF.Layout.Paragraphs; // TextParagraph, XhtmlParagraph
// After (IronPDF)
using IronPdf;
// Before (TallComponents — real namespaces)
using TallComponents.PDF; // Document, Page (PDFKit.NET)
using TallComponents.PDF.Shapes; // TextShape, ImageShape (PDFKit)
using TallComponents.PDF.Security; // PasswordSecurity
using TallComponents.PDF.Layout; // Document, Section (TallPDF.NET)
using TallComponents.PDF.Layout.Paragraphs; // TextParagraph, XhtmlParagraph
// After (IronPDF)
using IronPdf;
Imports IronPdf
' Before (TallComponents — real namespaces)
' Imports TallComponents.PDF ' Document, Page (PDFKit.NET)
' Imports TallComponents.PDF.Shapes ' TextShape, ImageShape (PDFKit)
' Imports TallComponents.PDF.Security ' PasswordSecurity
' Imports TallComponents.PDF.Layout ' Document, Section (TallPDF.NET)
' Imports TallComponents.PDF.Layout.Paragraphs ' TextParagraph, XhtmlParagraph
' After (IronPDF)
Imports IronPdf
步驟3:初始化您的授權
在應用啓動時新增授權初始化:
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY"
TallComponents到IronPDF API映射參考
了解TallComponents概念如何映射到IronPDF能加速遷移過程:
| TallComponents | IronPDF | 注釋 |
|---|---|---|
Document(TallPDF.NET:佈局) |
ChromePdfRenderer |
建立PDF生成的渲染器 |
Document(PDFKit.NET:處理) |
PdfDocument |
載入/編輯現有的PDF |
Section |
自動 | 從HTML結構導出的部分 |
TextParagraph |
HTML文字元素 | 使用<div>,等等。 |
ImageParagraph |
<img>標籤 |
標準HTML圖像 |
TableParagraph |
HTML <table> |
標準HTML表格 |
XhtmlParagraph(XHTML 1.x + CSS 2.1) |
RenderHtmlAsPdf()(HTML5/CSS3透過Chromium) |
現代HTML有效 |
Font |
CSS font-family |
支援網頁字體 |
document.Write(...) |
pdf.SaveAs() / pdf.BinaryData |
文件或byte[]輸出 |
page.Overlay.Add(shape) |
pdf.ApplyStamp(stamper) |
浮水印 / 疊加 |
outputDoc.Pages.Add(page.Clone()) |
PdfDocument.Merge(...) / pdf.AppendPdf(...) |
合併多個PDF |
Document.Security = new PasswordSecurity { ... } |
pdf.SecuritySettings |
PDF安全設置 |
PageLayout |
RenderingOptions |
頁面設置和邊界 |
程式碼遷移範例
將HTML轉換為PDF
TallComponents透過TallPDF.NET的XhtmlParagraph處理HTML,該工具僅能解析XHTML 1.0/1.1 + CSS 2.1。 現代的HTML5、CSS3、flexbox、grid 和 JavaScript驅動的內容超出了那種語法範圍:
TallComponents方法:
// NuGet: Install-Package TallComponents.TallPDF5
// (HTML/XHTML conversion lives in TallPDF.NET, not in PDFKit.NET.)
using TallComponents.PDF.Layout;
using TallComponents.PDF.Layout.Paragraphs;
using System.IO;
class Program
{
static void Main()
{
Document document = new Document();
Section section = document.Sections.Add();
// XhtmlParagraph supports XHTML 1.0/1.1 +CSS 2.1only.
XhtmlParagraph xhtml = new XhtmlParagraph();
xhtml.Text = "<html><body><h1>Hello World</h1><p>This is a PDF from XHTML.</p></body></html>";
section.Paragraphs.Add(xhtml);
using (FileStream fs = new FileStream("output.pdf", FileMode.Create))
{
document.Write(fs);
}
}
}
// NuGet: Install-Package TallComponents.TallPDF5
// (HTML/XHTML conversion lives in TallPDF.NET, not in PDFKit.NET.)
using TallComponents.PDF.Layout;
using TallComponents.PDF.Layout.Paragraphs;
using System.IO;
class Program
{
static void Main()
{
Document document = new Document();
Section section = document.Sections.Add();
// XhtmlParagraph supports XHTML 1.0/1.1 +CSS 2.1only.
XhtmlParagraph xhtml = new XhtmlParagraph();
xhtml.Text = "<html><body><h1>Hello World</h1><p>This is a PDF from XHTML.</p></body></html>";
section.Paragraphs.Add(xhtml);
using (FileStream fs = new FileStream("output.pdf", FileMode.Create))
{
document.Write(fs);
}
}
}
Imports TallComponents.PDF.Layout
Imports TallComponents.PDF.Layout.Paragraphs
Imports System.IO
Class Program
Shared Sub Main()
Dim document As New Document()
Dim section As Section = document.Sections.Add()
' XhtmlParagraph supports XHTML 1.0/1.1 +CSS 2.1 only.
Dim xhtml As New XhtmlParagraph()
xhtml.Text = "<html><body><h1>Hello World</h1><p>This is a PDF from XHTML.</p></body></html>"
section.Paragraphs.Add(xhtml)
Using fs As New FileStream("output.pdf", FileMode.Create)
document.Write(fs)
End Using
End Sub
End Class
IronPDF 方法:
// NuGet: Install-Package IronPdf
using IronPdf;
class Program
{
static void Main()
{
// Create a PDF fromHTMLstring
var renderer = new ChromePdfRenderer();
string html = "<html><body><h1>Hello World</h1><p>This is a PDF from HTML.</p></body></html>";
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("output.pdf");
}
}
// NuGet: Install-Package IronPdf
using IronPdf;
class Program
{
static void Main()
{
// Create a PDF fromHTMLstring
var renderer = new ChromePdfRenderer();
string html = "<html><body><h1>Hello World</h1><p>This is a PDF from HTML.</p></body></html>";
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("output.pdf");
}
}
Imports IronPdf
Class Program
Shared Sub Main()
' Create a PDF from HTML string
Dim renderer As New ChromePdfRenderer()
Dim html As String = "<html><body><h1>Hello World</h1><p>This is a PDF from HTML.</p></body></html>"
Dim pdf = renderer.RenderHtmlAsPdf(html)
pdf.SaveAs("output.pdf")
End Sub
End Class
IronPDF的ChromePdfRenderer使用真正的Chromium引擎,提供完整的HTML5和CSS3的支援。 這意味著您的PDF渲染將和在現代瀏覽器中看到的一模一樣。 在HTML到PDF教程中了解更多。
合併多個 PDF
PDF合併展示了TallComponents和IronPDF之間的冗長性差異。
TallComponents方法:
// NuGet: Install-Package TallComponents.PDFKit5
using TallComponents.PDF;
using System.IO;
class Program
{
static void Main()
{
// Create target document
Document outputDoc = new Document();
// Load first PDF and clone each page into the target
using (FileStream fs1 = new FileStream("document1.pdf", FileMode.Open, FileAccess.Read))
{
Document doc1 = new Document(fs1);
foreach (Page page in doc1.Pages)
{
outputDoc.Pages.Add(page.Clone()); // clone is required across documents
}
}
// Load second PDF and append the whole page collection
using (FileStream fs2 = new FileStream("document2.pdf", FileMode.Open, FileAccess.Read))
{
Document doc2 = new Document(fs2);
outputDoc.Pages.AddRange(doc2.Pages.CloneToArray());
}
// Save merged document
using (FileStream output = new FileStream("merged.pdf", FileMode.Create))
{
outputDoc.Write(output);
}
}
}
// NuGet: Install-Package TallComponents.PDFKit5
using TallComponents.PDF;
using System.IO;
class Program
{
static void Main()
{
// Create target document
Document outputDoc = new Document();
// Load first PDF and clone each page into the target
using (FileStream fs1 = new FileStream("document1.pdf", FileMode.Open, FileAccess.Read))
{
Document doc1 = new Document(fs1);
foreach (Page page in doc1.Pages)
{
outputDoc.Pages.Add(page.Clone()); // clone is required across documents
}
}
// Load second PDF and append the whole page collection
using (FileStream fs2 = new FileStream("document2.pdf", FileMode.Open, FileAccess.Read))
{
Document doc2 = new Document(fs2);
outputDoc.Pages.AddRange(doc2.Pages.CloneToArray());
}
// Save merged document
using (FileStream output = new FileStream("merged.pdf", FileMode.Create))
{
outputDoc.Write(output);
}
}
}
Imports TallComponents.PDF
Imports System.IO
Class Program
Shared Sub Main()
' Create target document
Dim outputDoc As New Document()
' Load first PDF and clone each page into the target
Using fs1 As New FileStream("document1.pdf", FileMode.Open, FileAccess.Read)
Dim doc1 As New Document(fs1)
For Each page As Page In doc1.Pages
outputDoc.Pages.Add(page.Clone()) ' clone is required across documents
Next
End Using
' Load second PDF and append the whole page collection
Using fs2 As New FileStream("document2.pdf", FileMode.Open, FileAccess.Read)
Dim doc2 As New Document(fs2)
outputDoc.Pages.AddRange(doc2.Pages.CloneToArray())
End Using
' Save merged document
Using output As New FileStream("merged.pdf", FileMode.Create)
outputDoc.Write(output)
End Using
End Sub
End Class
IronPDF 方法:
// NuGet: Install-Package IronPdf
using IronPdf;
class Program
{
static void Main()
{
// Load PDFs
var pdf1 = PdfDocument.FromFile("document1.pdf");
var pdf2 = PdfDocument.FromFile("document2.pdf");
// Merge PDFs
var merged = PdfDocument.Merge(pdf1, pdf2);
// Save merged document
merged.SaveAs("merged.pdf");
}
}
// NuGet: Install-Package IronPdf
using IronPdf;
class Program
{
static void Main()
{
// Load PDFs
var pdf1 = PdfDocument.FromFile("document1.pdf");
var pdf2 = PdfDocument.FromFile("document2.pdf");
// Merge PDFs
var merged = PdfDocument.Merge(pdf1, pdf2);
// Save merged document
merged.SaveAs("merged.pdf");
}
}
Imports IronPdf
Class Program
Shared Sub Main()
' Load PDFs
Dim pdf1 = PdfDocument.FromFile("document1.pdf")
Dim pdf2 = PdfDocument.FromFile("document2.pdf")
' Merge PDFs
Dim merged = PdfDocument.Merge(pdf1, pdf2)
' Save merged document
merged.SaveAs("merged.pdf")
End Sub
End Class
TallComponents的版本需要人工頁面迭代和克隆。 而IronPDF將此降低為單個PdfDocument.Merge()呼叫。 有關高級合併方案的進一步資訊,請參閱PDF合併文件。
新增水印
PDF上的水印揭示了另一個開發者體驗的重大差異。
TallComponents方法:
// NuGet: Install-Package TallComponents.PDFKit5
using TallComponents.PDF;
using TallComponents.PDF.Shapes;
using System.IO;
using System.Drawing;
class Program
{
static void Main()
{
// Load existing PDF
using (FileStream fs = new FileStream("input.pdf", FileMode.Open, FileAccess.Read))
{
Document document = new Document(fs);
foreach (Page page in document.Pages)
{
TextShape watermark = new TextShape();
watermark.Text = "CONFIDENTIAL";
watermark.Font = new Font("Arial", 60);
watermark.Pen = new Pen(Color.FromArgb(128, 255, 0, 0));
watermark.X = 200;
watermark.Y = 400;
// Rotation is applied via a transform on PDFKit.NET
// (TextShape has no Rotate property in the PDFKit API).
watermark.Transform = new RotateTransform(45);
page.Overlay.Add(watermark);
}
using (FileStream output = new FileStream("watermarked.pdf", FileMode.Create))
{
document.Write(output);
}
}
}
}
// NuGet: Install-Package TallComponents.PDFKit5
using TallComponents.PDF;
using TallComponents.PDF.Shapes;
using System.IO;
using System.Drawing;
class Program
{
static void Main()
{
// Load existing PDF
using (FileStream fs = new FileStream("input.pdf", FileMode.Open, FileAccess.Read))
{
Document document = new Document(fs);
foreach (Page page in document.Pages)
{
TextShape watermark = new TextShape();
watermark.Text = "CONFIDENTIAL";
watermark.Font = new Font("Arial", 60);
watermark.Pen = new Pen(Color.FromArgb(128, 255, 0, 0));
watermark.X = 200;
watermark.Y = 400;
// Rotation is applied via a transform on PDFKit.NET
// (TextShape has no Rotate property in the PDFKit API).
watermark.Transform = new RotateTransform(45);
page.Overlay.Add(watermark);
}
using (FileStream output = new FileStream("watermarked.pdf", FileMode.Create))
{
document.Write(output);
}
}
}
}
Imports TallComponents.PDF
Imports TallComponents.PDF.Shapes
Imports System.IO
Imports System.Drawing
Class Program
Shared Sub Main()
' Load existing PDF
Using fs As New FileStream("input.pdf", FileMode.Open, FileAccess.Read)
Dim document As New Document(fs)
For Each page As Page In document.Pages
Dim watermark As New TextShape()
watermark.Text = "CONFIDENTIAL"
watermark.Font = New Font("Arial", 60)
watermark.Pen = New Pen(Color.FromArgb(128, 255, 0, 0))
watermark.X = 200
watermark.Y = 400
' Rotation is applied via a transform on PDFKit.NET
' (TextShape has no Rotate property in the PDFKit API).
watermark.Transform = New RotateTransform(45)
page.Overlay.Add(watermark)
Next
Using output As New FileStream("watermarked.pdf", FileMode.Create)
document.Write(output)
End Using
End Using
End Sub
End Class
IronPDF 方法:
// NuGet: Install-Package IronPdf
using IronPdf;
using IronPdf.Editing;
class Program
{
static void Main()
{
// Load existing PDF
var pdf = PdfDocument.FromFile("input.pdf");
// Create watermark
var watermark = new TextStamper()
{
Text = "CONFIDENTIAL",
FontSize = 60,
Opacity = 50,
Rotation = 45,
VerticalAlignment = VerticalAlignment.Middle,
HorizontalAlignment = HorizontalAlignment.Center
};
// Apply watermark to all pages
pdf.ApplyStamp(watermark);
// Save watermarked PDF
pdf.SaveAs("watermarked.pdf");
}
}
// NuGet: Install-Package IronPdf
using IronPdf;
using IronPdf.Editing;
class Program
{
static void Main()
{
// Load existing PDF
var pdf = PdfDocument.FromFile("input.pdf");
// Create watermark
var watermark = new TextStamper()
{
Text = "CONFIDENTIAL",
FontSize = 60,
Opacity = 50,
Rotation = 45,
VerticalAlignment = VerticalAlignment.Middle,
HorizontalAlignment = HorizontalAlignment.Center
};
// Apply watermark to all pages
pdf.ApplyStamp(watermark);
// Save watermarked PDF
pdf.SaveAs("watermarked.pdf");
}
}
Imports IronPdf
Imports IronPdf.Editing
Class Program
Shared Sub Main()
' Load existing PDF
Dim pdf = PdfDocument.FromFile("input.pdf")
' Create watermark
Dim watermark = New TextStamper() With {
.Text = "CONFIDENTIAL",
.FontSize = 60,
.Opacity = 50,
.Rotation = 45,
.VerticalAlignment = VerticalAlignment.Middle,
.HorizontalAlignment = HorizontalAlignment.Center
}
' Apply watermark to all pages
pdf.ApplyStamp(watermark)
' Save watermarked PDF
pdf.SaveAs("watermarked.pdf")
End Sub
End Class
IronPDF的TextStamper類提供直觀的對齊選項和自動頁面迭代。 加蓋和水印指南涵蓋其他自定義選項。
數位簽名
文件簽名對於企業應用至關重要。
TallComponents方法:
using TallComponents.PDF;
using TallComponents.PDF.Signing;
using System.IO;
using System.Security.Cryptography.X509Certificates;
using (FileStream fs = new FileStream("unsigned.pdf", FileMode.Open, FileAccess.Read))
{
Document document = new Document(fs);
X509Certificate2 cert = new X509Certificate2("certificate.pfx", "password");
SignatureField field = new SignatureField("Signature1");
field.Sign(cert);
document.Fields.Add(field);
using (FileStream output = new FileStream("signed.pdf", FileMode.Create))
{
document.Write(output);
}
}
using TallComponents.PDF;
using TallComponents.PDF.Signing;
using System.IO;
using System.Security.Cryptography.X509Certificates;
using (FileStream fs = new FileStream("unsigned.pdf", FileMode.Open, FileAccess.Read))
{
Document document = new Document(fs);
X509Certificate2 cert = new X509Certificate2("certificate.pfx", "password");
SignatureField field = new SignatureField("Signature1");
field.Sign(cert);
document.Fields.Add(field);
using (FileStream output = new FileStream("signed.pdf", FileMode.Create))
{
document.Write(output);
}
}
Imports TallComponents.PDF
Imports TallComponents.PDF.Signing
Imports System.IO
Imports System.Security.Cryptography.X509Certificates
Using fs As New FileStream("unsigned.pdf", FileMode.Open, FileAccess.Read)
Dim document As New Document(fs)
Dim cert As New X509Certificate2("certificate.pfx", "password")
Dim field As New SignatureField("Signature1")
field.Sign(cert)
document.Fields.Add(field)
Using output As New FileStream("signed.pdf", FileMode.Create)
document.Write(output)
End Using
End Using
IronPDF 方法:
using IronPdf;
using IronPdf.Signing;
var pdf = PdfDocument.FromFile("unsigned.pdf");
// Sign with certificate
var signature = new PdfSignature("certificate.pfx", "password")
{
SigningContact = "support@company.com",
SigningLocation = "New York",
SigningReason = "Document Approval"
};
pdf.Sign(signature);
pdf.SaveAs("signed.pdf");
using IronPdf;
using IronPdf.Signing;
var pdf = PdfDocument.FromFile("unsigned.pdf");
// Sign with certificate
var signature = new PdfSignature("certificate.pfx", "password")
{
SigningContact = "support@company.com",
SigningLocation = "New York",
SigningReason = "Document Approval"
};
pdf.Sign(signature);
pdf.SaveAs("signed.pdf");
Imports IronPdf
Imports IronPdf.Signing
Dim pdf = PdfDocument.FromFile("unsigned.pdf")
' Sign with certificate
Dim signature = New PdfSignature("certificate.pfx", "password") With {
.SigningContact = "support@company.com",
.SigningLocation = "New York",
.SigningReason = "Document Approval"
}
pdf.Sign(signature)
pdf.SaveAs("signed.pdf")
IronPDF的簽名API包括附加的元資料屬性,用於聯繫資訊、位置和簽名原因——對於審計記錄很重要。 探索數位簽名文件,了解完整的實施詳細資訊。
功能比較:TallComponents對比IronPDF
| 功能 | TallComponents | IronPDF |
|---|---|---|
| 狀態 | 新授權已關閉(Apryse於2025-05-27收購) | 活躍 |
| 支援 | 僅限現有客戶 | 全面 |
| 更新 | 僅限於維護 | 定期功能發布 |
| 內容建立 | ||
| HTML轉PDF | XHTML 1.0/1.1 + CSS 2.1(XhtmlParagraph) |
通過Chromium完整的HTML5 / CSS3支援 |
| URL到PDF | 是的,用於XHTML URLs(XhtmlParagraph.Path) |
是 |
| CSS支持 | CSS 2.1 | 完整支持 CSS3 |
| JavaScript | 否 | 完整的ES2024 |
| XML / 佈局DOM模版 | 是的(TallPDF.NET) | 不需要(HTML) |
| PDF操作 | ||
| 合併PDF | 是的(Pages.Add(page.Clone())) |
是的(PdfDocument.Merge) |
| 拆分PDF | 是 | 是 |
| 浮水印 | page.Overlay.Add(TextShape) |
pdf.ApplyStamp(...) |
| 頁眉/頁腳 | 佈局DOM | HTML/CSS |
| 安全性 | ||
| 密碼保護 | 是的(PasswordSecurity) |
是 |
| 數位簽名 | 是的(SignatureField.Sign) |
是 |
| 加密 | RC4 / AES-128 / AES-256 | AES-128 / AES-256 |
| PDF/A | PDF/A-1, PDF/A-2, PDF/A-3 | 是 |
| 平台 | ||
| 目標框架 | PDFKit5:.NET Standard 2.0; PDFKit(4.x):.NET Framework 2.0 | .NET Framework 4.6.2+, .NET 6/7/8/9 |
| 開發 | ||
| 學習曲線 | XML / 佈局DOM | HTML |
| 文件 | 在收購時凍結; 新的文件引導到Apryse / iText | 保持 |
| 社區支持 | 安靜(無新銷售) | 活躍 |
TallComponents遷移清單
遷移前任務
審查您的程式碼庫,以識別所有使用的TallComponents:
grep -r "using TallComponents" --include="*.cs" .
grep -rE "XhtmlParagraph|TextParagraph|PasswordSecurity|page\.Overlay" --include="*.cs" .
grep -r "using TallComponents" --include="*.cs" .
grep -rE "XhtmlParagraph|TextParagraph|PasswordSecurity|page\.Overlay" --include="*.cs" .
文件現有的XML/佈局模版——這些將被轉換為HTML。 識別目前使用的安全設置,記錄密碼配置和數位簽名實施。
程式碼更新任務
- 通過NuGet移除TallComponents套件
- 安裝IronPDF套件
- 將XHTML / 佈局DOM模版轉換為HTML5
- 用HTML元素替換Section/Paragraph模型
- 更新表格程式碼以使用標準HTML表格
- 使用
HtmlHeaderFooter將標題/頁腳轉換為HTML - 更新安全設置,以使用
pdf.SecuritySettings - 在啟動時新增授權初始化
標題與頁腳遷移
TallPDF.NET使用佈局DOM(Section.Header / Section.Footer)作為頁面標題。 IronPDF提供基於HTML的帶有動態佔位符的標題:
renderer.RenderingOptions.HtmlHeader = new HtmlHeaderFooter()
{
HtmlFragment = "<div style='text-align:center;'>Header Text</div>",
MaxHeight = 25
};
renderer.RenderingOptions.HtmlFooter = new HtmlHeaderFooter()
{
HtmlFragment = "<div style='text-align:center;'>Footer Text</div>",
MaxHeight = 25
};
renderer.RenderingOptions.HtmlHeader = new HtmlHeaderFooter()
{
HtmlFragment = "<div style='text-align:center;'>Header Text</div>",
MaxHeight = 25
};
renderer.RenderingOptions.HtmlFooter = new HtmlHeaderFooter()
{
HtmlFragment = "<div style='text-align:center;'>Footer Text</div>",
MaxHeight = 25
};
Imports System
renderer.RenderingOptions.HtmlHeader = New HtmlHeaderFooter() With {
.HtmlFragment = "<div style='text-align:center;'>Header Text</div>",
.MaxHeight = 25
}
renderer.RenderingOptions.HtmlFooter = New HtmlHeaderFooter() With {
.HtmlFragment = "<div style='text-align:center;'>Footer Text</div>",
.MaxHeight = 25
}
進一步了解IronPDF中的標題和頁腳。
測試階段
- 比較TallComponents和IronPDF版本的視覺輸出
- 測試所有文件模板
- 驗證PDF合併功能
- 測試數位簽名
- 確認安全設置正確應用
推薦的遷移時間表
由於TallComponents已關閉新授權並且僅提供維護支援,請以自己的步調計劃移動,但不要延遲:
第1週:審核程式碼庫並識別所有TallComponents使用 第2週:將XHTML / 佈局模板轉換為HTML5 第3週:更新安全、合併和簽名程式碼 第4週:測試和產品部署
堆棧在TallComponents上停留的時間越長,越偏離當前的.NET目標和當前的HTML。
[[i:(Apryse、PDFKit、Tall Components和iText是各自所有者的註冊商標。 本網站與Apryse、PDFKit、PDFTron、TallComponents或iText Group無關聯,亦非經其認可或贊助。所有產品名稱、徽標和品牌均為其各自所有者的財產。 比較僅供參考,反映撰寫時公開可用的資訊。)]]

