IRONSOFTWAREHOME
影片

如何在 Docker 中使用 IronPDF 引擎 | IronPDF

Curtis Chau
Curtis Chau
Updated: 2026年7月19日

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使用者的核心缺口:

功能TallComponentsIronPDF
當前銷售狀態新授權已關閉(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.TallPDF5NuGet(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
SHELL

安裝 IronPDF:

dotnet add package IronPdf

對於專用框架,IronPDF提供專門的擴充套件包:

Blazor Server:

PM > Install-Package IronPdf.Extensions.Blazor

MAUI:

PM > Install-Package IronPdf.Extensions.Maui

MVC Framework:

PM > 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;

步驟3:初始化您的授權

在應用啓動時新增授權初始化:

IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";

TallComponents到IronPDF API映射參考

了解TallComponents概念如何映射到IronPDF能加速遷移過程:

TallComponentsIronPDF注釋
Document(TallPDF.NET:佈局)ChromePdfRenderer建立PDF生成的渲染器
Document(PDFKit.NET:處理)PdfDocument載入/編輯現有的PDF
Section自動從HTML結構導出的部分
TextParagraphHTML文字元素使用<div>,等等。
ImageParagraph<img>標籤標準HTML圖像
TableParagraphHTML <table>標準HTML表格
XhtmlParagraph(XHTML 1.x + CSS 2.1)RenderHtmlAsPdf()(HTML5/CSS3透過Chromium)現代HTML有效
FontCSS 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.SecuritySettingsPDF安全設置
PageLayoutRenderingOptions頁面設置和邊界

程式碼遷移範例

將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);
        }
    }
}
C#

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");
    }
}
C#

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);
        }
    }
}

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");
    }
}

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);
            }
        }
    }
}

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");
    }
}

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);
    }
}

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");

IronPDF的簽名API包括附加的元資料屬性,用於聯繫資訊、位置和簽名原因——對於審計記錄很重要。 探索數位簽名文件,了解完整的實施詳細資訊。

功能比較:TallComponents對比IronPDF

功能TallComponentsIronPDF
狀態新授權已關閉(Apryse於2025-05-27收購)活躍
支援僅限現有客戶全面
更新僅限於維護定期功能發布
內容建立
HTML轉PDFXHTML 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(...)
頁眉/頁腳佈局DOMHTML/CSS
安全性
密碼保護是的(PasswordSecurity
數位簽名是的(SignatureField.Sign
加密RC4 / AES-128 / AES-256AES-128 / AES-256
PDF/APDF/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 / 佈局DOMHTML
文件在收購時凍結; 新的文件引導到Apryse / iText保持
社區支持安靜(無新銷售)活躍

TallComponents遷移清單

遷移前任務

審查您的程式碼庫,以識別所有使用的TallComponents:

grep -r "using TallComponents" --include="*.cs" .
grep -rE "XhtmlParagraph|TextParagraph|PasswordSecurity|page\.Overlay" --include="*.cs" .
SHELL

文件現有的XML/佈局模版——這些將被轉換為HTML。 識別目前使用的安全設置,記錄密碼配置和數位簽名實施。

程式碼更新任務

  1. 通過NuGet移除TallComponents套件
  2. 安裝IronPDF套件
  3. 將XHTML / 佈局DOM模版轉換為HTML5
  4. 用HTML元素替換Section/Paragraph模型
  5. 更新表格程式碼以使用標準HTML表格
  6. 使用HtmlHeaderFooter將標題/頁腳轉換為HTML
  7. 更新安全設置,以使用pdf.SecuritySettings
  8. 在啟動時新增授權初始化

標題與頁腳遷移

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
};

進一步了解IronPDF中的標題和頁腳

測試階段

  1. 比較TallComponents和IronPDF版本的視覺輸出
  2. 測試所有文件模板
  3. 驗證PDF合併功能
  4. 測試數位簽名
  5. 確認安全設置正確應用

推薦的遷移時間表

由於TallComponents已關閉新授權並且僅提供維護支援,請以自己的步調計劃移動,但不要延遲:

**第1週:**審核程式碼庫並識別所有TallComponents使用 **第2週:**將XHTML / 佈局模板轉換為HTML5 **第3週:**更新安全、合併和簽名程式碼 **第4週:**測試和產品部署

堆棧在TallComponents上停留的時間越長,越偏離當前的.NET目標和當前的HTML。

[[i:(Apryse、PDFKit、Tall Components和iText是各自所有者的註冊商標。 本網站與Apryse、PDFKit、PDFTron、TallComponents或iText Group無關聯,亦非經其認可或贊助。所有產品名稱、徽標和品牌均為其各自所有者的財產。 比較僅供參考,反映撰寫時公開可用的資訊。)]]

Curtis Chau
技術作家

Curtis Chau擁有Carleton大學的電腦科學學士學位,專精於前端開發,擁有Node.js、TypeScript、JavaScript和React的專業知識。Curtis熱衷於建立直觀且美觀的使用者介面,喜愛使用現代框架並建立結構良好、視覺吸引力的手冊。

...
閱讀更多

相關文章

Key in blue circle

立即免費取得 30 天試用金鑰

Your trial license will be sent to your email address

無任何限制。100% 解鎖。無需信用卡。

bullet_checked無需信用卡或建立帳號無任何限制。100% 解鎖。無需信用卡。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
預訂您的免費現場演示
Booking Badge

受到全球數百萬工程師的信任

Iron Software的客戶標誌
獲取您的無義務諮詢
填寫以下表格或電子郵件sales@ironsoftware.com
您的詳細資訊將始終保密
受到全球數百萬工程師的信任
Iron Software的客戶標誌
立即獲取您的30天試用金鑰
無需信用卡或帳戶建立