跳過到頁腳內容
遷移指南

如何用 C# 從 Winnovative 轉移到 IronPDF

Migrating fromWinnovativeto IronPdf:完整的 C# 開發人員指南。

Winnovative 一直是 .NET PDF 生成領域的知名品牌,為 C# 應用程式提供 HTML 至 PDF 的轉換功能。 然而,該函式庫依賴 2016 年的 WebKit 引擎,對現代網路開發造成重大挑戰。 現代 CSS 功能(如網格佈局)、現代 JavaScript 語法以及 Bootstrap 5 和 Tailwind CSS 等熱門架構經常無法正確呈現,甚至完全無法呈現。

本指南提供了從Winnovative到IronPDF的完整轉換路徑,並提供分步說明、程式碼比較以及實用範例,可供評估此轉換的 .NET 專業開發人員使用。

為什麼要從Winnovative遷移?

Winnovative 依賴於 2016 年的 WebKit 引擎,對於現代的 Web 應用程式造成嚴重的問題:

No CSS Grid Support:Bootstrap 5、Tailwind CSS 和現代佈局完全破壞。 任何使用 CSS Grid 的頁面將無法如預期般呈現。

Buggy Flexbox Implementation:與現代瀏覽器相比,呈現不一致。 開發人員經常花費數小時來調試只存在於Winnovative中的排版問題。

ES5 JavaScript Only:現代 ES6+ JavaScript 功能(箭頭函式、async/await、類別)會無聲失效。 這意味著 React、Vue 和其他現代框架經常會產生破損的輸出。

停滯不前的開發:儘管 "Winnovative "暗示著創新,但近年來產品的更新卻少之又少。

字體渲染問題:網頁字型和自訂排版經常會呈現不正確或完全無法呈現。

安全性疑慮:2016 年的 WebKit 引擎缺乏多年的安全修補程式和漏洞修復。

真實世界的影響力

現代的 CSS 和 JavaScript 在Winnovative中根本無法運作:

<!-- This modern CSS breaks inWinnovative-->
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;">
  <div>Column 1</div>
  <div>Column 2</div>
  <div>Column 3</div>
</div>

<!-- Modern JavaScript fails silently -->
<script>
const items = data.map(item => item.name); // Arrow functions: FAIL
const result = await fetchData(); // Async/await: FAIL
class Report { } // Classes: FAIL
</script>
<!-- This modern CSS breaks inWinnovative-->
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;">
  <div>Column 1</div>
  <div>Column 2</div>
  <div>Column 3</div>
</div>

<!-- Modern JavaScript fails silently -->
<script>
const items = data.map(item => item.name); // Arrow functions: FAIL
const result = await fetchData(); // Async/await: FAIL
class Report { } // Classes: FAIL
</script>
HTML

IronPDFvs Winnovative:功能比較

了解架構上的差異有助於技術決策者評估遷移投資:

範疇WinnovativeIronPDF
渲染引擎WebKit (2016)Chromium (目前)
CSS 網格不支援全面支援
<強>Flexbox</強錯誤全面支援
JavaScript僅限 ES5ES2024
Bootstrap 5破損全面支援
尾風 CSS不支援全面支援
React/Vue SSR問題完美運作
網路字型不可靠全面支援
更新不經常每月
價格$750-$1,600競爭力

快速入門:Winnovative 到IronPDF的遷移。

只要完成這些基本步驟,就可以立即開始遷移。

步驟 1:取代 NuGet 套件

移除所有Winnovative套件:

# Remove Winnovative
dotnet remove package Winnovative.WebKitHtmlToPdf
dotnet remove package Winnovative.HtmlToPdf
dotnet remove package Winnovative.WebToPdfConverter
# Remove Winnovative
dotnet remove package Winnovative.WebKitHtmlToPdf
dotnet remove package Winnovative.HtmlToPdf
dotnet remove package Winnovative.WebToPdfConverter
SHELL

安裝 IronPDF:

# Install IronPDF
dotnet add package IronPdf
# Install IronPDF
dotnet add package IronPdf
SHELL

步驟 2:更新命名空間

用 IronPdf 命名空間取代Winnovative命名空間:

// Before (Winnovative)
using Winnovative;
using Winnovative.WebKit;

// After (IronPDF)
using IronPdf;
// Before (Winnovative)
using Winnovative;
using Winnovative.WebKit;

// After (IronPDF)
using IronPdf;
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

步驟 3:初始化授權

在應用程式啟動時加入授權初始化:

IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY"
$vbLabelText   $csharpLabel

程式碼遷移範例

將 HTML 轉換為 PDF

最常見的使用案例展示了這些 .NET PDF 函式庫之間的 API 差異。

創新方法:

// NuGet: Install-Package Winnovative.WebToPdfConverter
using Winnovative;
using System;

class Program
{
    static void Main()
    {
        // Create the HTML to PDF converter
        HtmlToPdfConverter htmlToPdfConverter = new HtmlToPdfConverter();

        // Set license key
        htmlToPdfConverter.LicenseKey = "your-license-key";

        // Convert HTML string to PDF
        string htmlString = "<html><body><h1>Hello World</h1></body></html>";
        byte[] pdfBytes = htmlToPdfConverter.ConvertHtml(htmlString, "");

        // Save to file
        System.IO.File.WriteAllBytes("output.pdf", pdfBytes);

        Console.WriteLine("PDF created successfully");
    }
}
// NuGet: Install-Package Winnovative.WebToPdfConverter
using Winnovative;
using System;

class Program
{
    static void Main()
    {
        // Create the HTML to PDF converter
        HtmlToPdfConverter htmlToPdfConverter = new HtmlToPdfConverter();

        // Set license key
        htmlToPdfConverter.LicenseKey = "your-license-key";

        // Convert HTML string to PDF
        string htmlString = "<html><body><h1>Hello World</h1></body></html>";
        byte[] pdfBytes = htmlToPdfConverter.ConvertHtml(htmlString, "");

        // Save to file
        System.IO.File.WriteAllBytes("output.pdf", pdfBytes);

        Console.WriteLine("PDF created successfully");
    }
}
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

IronPDF 方法:

// NuGet: Install-Package IronPdf
using IronPdf;
using System;

class Program
{
    static void Main()
    {
        // Create a PDF renderer
        var renderer = new ChromePdfRenderer();

        // Convert HTML string to PDF
        string htmlString = "<html><body><h1>Hello World</h1></body></html>";
        var pdf = renderer.RenderHtmlAsPdf(htmlString);

        // Save to file
        pdf.SaveAs("output.pdf");

        Console.WriteLine("PDF created successfully");
    }
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System;

class Program
{
    static void Main()
    {
        // Create a PDF renderer
        var renderer = new ChromePdfRenderer();

        // Convert HTML string to PDF
        string htmlString = "<html><body><h1>Hello World</h1></body></html>";
        var pdf = renderer.RenderHtmlAsPdf(htmlString);

        // Save to file
        pdf.SaveAs("output.pdf");

        Console.WriteLine("PDF created successfully");
    }
}
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Winnovative 需要創建一個<編碼>HtmlToPdfConverter</編碼,在實例上設定許可金鑰,以一個空的基本 URL 參數呼叫 ConvertHtml() ,接收原始位元組,並手動寫入檔案。IronPDF 簡化了這個過程:建立一個 ChromePdfRenderer, 呼叫 RenderHtmlAsPdf(), 並使用內建的 SaveAs() 方法。

如需進階的 HTML 至IronPDF情境,請參閱 HTML 至 PDF 轉換指南

將 URL 轉換為 PDF

URL 到 PDF 的轉換也顯示出類似的模式。

創新方法:

// NuGet: Install-Package Winnovative.WebToPdfConverter
using Winnovative;
using System;

class Program
{
    static void Main()
    {
        // Create the HTML to PDF converter
        HtmlToPdfConverter htmlToPdfConverter = new HtmlToPdfConverter();

        // Set license key
        htmlToPdfConverter.LicenseKey = "your-license-key";

        // Convert URL to PDF
        string url = "https://www.example.com";
        byte[] pdfBytes = htmlToPdfConverter.ConvertUrl(url);

        // Save to file
        System.IO.File.WriteAllBytes("webpage.pdf", pdfBytes);

        Console.WriteLine("PDF from URL created successfully");
    }
}
// NuGet: Install-Package Winnovative.WebToPdfConverter
using Winnovative;
using System;

class Program
{
    static void Main()
    {
        // Create the HTML to PDF converter
        HtmlToPdfConverter htmlToPdfConverter = new HtmlToPdfConverter();

        // Set license key
        htmlToPdfConverter.LicenseKey = "your-license-key";

        // Convert URL to PDF
        string url = "https://www.example.com";
        byte[] pdfBytes = htmlToPdfConverter.ConvertUrl(url);

        // Save to file
        System.IO.File.WriteAllBytes("webpage.pdf", pdfBytes);

        Console.WriteLine("PDF from URL created successfully");
    }
}
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

IronPDF 方法:

// NuGet: Install-Package IronPdf
using IronPdf;
using System;

class Program
{
    static void Main()
    {
        // Create a PDF renderer
        var renderer = new ChromePdfRenderer();

        // Convert URL to PDF
        string url = "https://www.example.com";
        var pdf = renderer.RenderUrlAsPdf(url);

        // Save to file
        pdf.SaveAs("webpage.pdf");

        Console.WriteLine("PDF from URL created successfully");
    }
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System;

class Program
{
    static void Main()
    {
        // Create a PDF renderer
        var renderer = new ChromePdfRenderer();

        // Convert URL to PDF
        string url = "https://www.example.com";
        var pdf = renderer.RenderUrlAsPdf(url);

        // Save to file
        pdf.SaveAs("webpage.pdf");

        Console.WriteLine("PDF from URL created successfully");
    }
}
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Winnovative 使用 ConvertUrl() 返回必須手動儲存的位元組。IronPDF提供 RenderUrlAsPdf() 與<編碼>PDF 文件</編碼物件,其中包含 SaveAs() 以方便使用。

探索URL至PDF文件的認證和自訂標頭選項。

新增頁首與頁尾

頁首和頁尾揭示了顯著的架構差異。Winnovative使用以文字元素物件為基礎的程式化元素方法,而 IronPdf 則使用以 HTML 為基礎的標頭與佔位符記號。

創新方法:

// NuGet: Install-Package Winnovative.WebToPdfConverter
using Winnovative;
using System;
using System.Drawing;

class Program
{
    static void Main()
    {
        // Create the HTML to PDF converter
        HtmlToPdfConverter htmlToPdfConverter = new HtmlToPdfConverter();

        // Set license key
        htmlToPdfConverter.LicenseKey = "your-license-key";

        // Enable header
        htmlToPdfConverter.PdfDocumentOptions.ShowHeader = true;
        htmlToPdfConverter.PdfHeaderOptions.HeaderHeight = 60;

        // Add header text
        TextElement headerText = new TextElement(0, 0, "Document Header", new Font("Arial", 12));
        htmlToPdfConverter.PdfHeaderOptions.AddElement(headerText);

        // Enable footer
        htmlToPdfConverter.PdfDocumentOptions.ShowFooter = true;
        htmlToPdfConverter.PdfFooterOptions.FooterHeight = 60;

        // Add footer with page number
        TextElement footerText = new TextElement(0, 0, "Page &p; of &P;", new Font("Arial", 10));
        htmlToPdfConverter.PdfFooterOptions.AddElement(footerText);

        // Convert HTML to PDF
        string htmlString = "<html><body><h1>Document with Header and Footer</h1><p>Content goes here</p></body></html>";
        byte[] pdfBytes = htmlToPdfConverter.ConvertHtml(htmlString, "");

        // Save to file
        System.IO.File.WriteAllBytes("document.pdf", pdfBytes);

        Console.WriteLine("PDF with header and footer created successfully");
    }
}
// NuGet: Install-Package Winnovative.WebToPdfConverter
using Winnovative;
using System;
using System.Drawing;

class Program
{
    static void Main()
    {
        // Create the HTML to PDF converter
        HtmlToPdfConverter htmlToPdfConverter = new HtmlToPdfConverter();

        // Set license key
        htmlToPdfConverter.LicenseKey = "your-license-key";

        // Enable header
        htmlToPdfConverter.PdfDocumentOptions.ShowHeader = true;
        htmlToPdfConverter.PdfHeaderOptions.HeaderHeight = 60;

        // Add header text
        TextElement headerText = new TextElement(0, 0, "Document Header", new Font("Arial", 12));
        htmlToPdfConverter.PdfHeaderOptions.AddElement(headerText);

        // Enable footer
        htmlToPdfConverter.PdfDocumentOptions.ShowFooter = true;
        htmlToPdfConverter.PdfFooterOptions.FooterHeight = 60;

        // Add footer with page number
        TextElement footerText = new TextElement(0, 0, "Page &p; of &P;", new Font("Arial", 10));
        htmlToPdfConverter.PdfFooterOptions.AddElement(footerText);

        // Convert HTML to PDF
        string htmlString = "<html><body><h1>Document with Header and Footer</h1><p>Content goes here</p></body></html>";
        byte[] pdfBytes = htmlToPdfConverter.ConvertHtml(htmlString, "");

        // Save to file
        System.IO.File.WriteAllBytes("document.pdf", pdfBytes);

        Console.WriteLine("PDF with header and footer created successfully");
    }
}
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

IronPDF 方法:

// NuGet: Install-Package IronPdf
using IronPdf;
using IronPdf.Rendering;
using System;

class Program
{
    static void Main()
    {
        // Create a PDF renderer
        var renderer = new ChromePdfRenderer();

        // Configure header and footer
        renderer.RenderingOptions.TextHeader = new TextHeaderFooter()
        {
            CenterText = "Document Header",
            FontSize = 12
        };

        renderer.RenderingOptions.TextFooter = new TextHeaderFooter()
        {
            CenterText = "Page {page} of {total-pages}",
            FontSize = 10
        };

        // Convert HTML to PDF
        string htmlString = "<html><body><h1>Document with Header and Footer</h1><p>Content goes here</p></body></html>";
        var pdf = renderer.RenderHtmlAsPdf(htmlString);

        // Save to file
        pdf.SaveAs("document.pdf");

        Console.WriteLine("PDF with header and footer created successfully");
    }
}
// NuGet: Install-Package IronPdf
using IronPdf;
using IronPdf.Rendering;
using System;

class Program
{
    static void Main()
    {
        // Create a PDF renderer
        var renderer = new ChromePdfRenderer();

        // Configure header and footer
        renderer.RenderingOptions.TextHeader = new TextHeaderFooter()
        {
            CenterText = "Document Header",
            FontSize = 12
        };

        renderer.RenderingOptions.TextFooter = new TextHeaderFooter()
        {
            CenterText = "Page {page} of {total-pages}",
            FontSize = 10
        };

        // Convert HTML to PDF
        string htmlString = "<html><body><h1>Document with Header and Footer</h1><p>Content goes here</p></body></html>";
        var pdf = renderer.RenderHtmlAsPdf(htmlString);

        // Save to file
        pdf.SaveAs("document.pdf");

        Console.WriteLine("PDF with header and footer created successfully");
    }
}
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Winnovative 要求通過 PdfDocumentOptions.ShowHeader 啟用頁首/頁尾,設定高度,創建具有坐標位置的文字元素物件和 System.Drawing.Font 物件,並使用 &p;&P; 占位符。 IronPdf 使用 TextHeaderFooter 物件,該物件具有 CenterTextFontSize 等簡單的屬性,以及 {page}{total-pages} 等直觀的占位符。

如需使用完整 CSS 定型的 HTML 型標頭,請參閱 標頭和頁尾文件

WinnovativeAPI 到IronPDF的映射參考。

此對應可透過顯示直接的 API 對應關係來加速遷移:

Winnovative ClassIronPdf 同等級產品筆記
<編碼>HtmlToPdfConverter</編碼<代碼>ChromePdfRenderer</代碼主要轉換類
<編碼>PDF 文件</編碼<編碼>PDF 文件</編碼PDF 操作
<代碼>PdfDocumentOptions</代碼渲染選項配置
<代碼>PdfHeaderOptions</代碼<編碼>HtmlHeaderFooter</編碼標題
<代碼>PdfFooterOptions</代碼<編碼>HtmlHeaderFooter</編碼頁腳
文字元素HtmlFragment 中的 HTML文字定位
圖像元素HTML <img>圖片放置

方法映射

Winnovative 方法IronPdf 方法
<編碼>ConvertUrl(url)</編碼<代碼>RenderUrlAsPdf(url)</代碼
ConvertUrlToFile(url,路徑)<代碼>RenderUrlAsPdf(url).SaveAs(path)</代碼
ConvertHtml(html, baseUrl)RenderHtmlAsPdf(html)
ConvertHtmlToFile(html,路徑)RenderHtmlAsPdf(html).SaveAs(path)
<編碼>ConvertHtmlFile(路徑)</編碼RenderHtmlFileAsPdf(path)
MergePdf(流)<代碼>PdfDocument.Merge(pdfs)</代碼
<編碼>AppendPdf(pdf)</編碼pdf1.AppendPdf(pdf2)

選項對應

Winnovative 選項IronPdf 選項
<編碼>PdfPageSize.A4</編碼PaperSize = PdfPaperSize.A4 紙張尺寸
PdfPageSize.LetterPaperSize=PdfPaperSize.Letter
<編碼>PdfPageOrientation.Portrait</編碼PaperOrientation=PdfPaperOrientation.Portrait(紙張方向)
<編碼>PdfPageOrientation.Landscape</編碼PaperOrientation=PdfPaperOrientation.Landscape
TopMargin = 20MarginTop = 20
BottomMargin = 20MarginBottom = 20
左邊距 = 15MarginLeft = 15
RightMargin = 15MarginRight = 15
ShowHeader=true設定 HtmlHeader 屬性
ShowFooter = true設定 HtmlFooter 屬性
JavaScriptEnabled = trueEnableJavaScript = true
頁碼 &p;頁碼 {page}
總頁數 &P;總頁數 {total-pages}

常見的遷移問題與解決方案

問題 1:CSS 排版看起來不一樣

症狀:在Winnovative中看起來 "還行 "的佈局,現在在IronPDF中看起來不一樣了。

起因:Winnovative的 2016 WebKit 有一些渲染 bug,開發人員都能解決。IronPDF可根據現代標準正確渲染。

解決方案:移除Winnovative特有的 CSS hack,並使用標準 CSS:

// Clean up legacy CSS
string cleanedHtml = html
    .Replace("-webkit-flex", "flex")
    .Replace("display: -webkit-box", "display: flex");
// Clean up legacy CSS
string cleanedHtml = html
    .Replace("-webkit-flex", "flex")
    .Replace("display: -webkit-box", "display: flex");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

問題 2:JavaScript 無法執行

症狀:動態內容未顯示在 PDF 中。

原因:需要明確設定 JavaScript 等待選項。

解決方案:

renderer.RenderingOptions.EnableJavaScript = true;
renderer.RenderingOptions.WaitFor.JavaScript(5000);
// Or wait for specific element
renderer.RenderingOptions.WaitFor.HtmlElementById("content-ready", 10000);
renderer.RenderingOptions.EnableJavaScript = true;
renderer.RenderingOptions.WaitFor.JavaScript(5000);
// Or wait for specific element
renderer.RenderingOptions.WaitFor.HtmlElementById("content-ready", 10000);
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

問題 3:基本 URL 無法運作

症狀:圖片和 CSS 的相對 URL 無法解析。

原因:IronPDF需要明確的基本 URL 設定。

解決方案:

renderer.RenderingOptions.BaseUrl = new Uri("https://example.com/");
renderer.RenderingOptions.BaseUrl = new Uri("https://example.com/");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

問題 4:不同的分頁符

症狀:內容在與Winnovative不同的地方斷裂。

原因:不同的呈現引擎會以不同的方式處理分頁符號。

解決方案:使用明確的 CSS 分頁控制:

/* Control page breaks explicitly */
.no-break {
    page-break-inside: avoid;
}
.page-break-before {
    page-break-before: always;
}
.page-break-after {
    page-break-after: always;
}

問題 5:字型外觀不同

症狀:文字出現的字型與預期的不同。

原因:IronPDF使用系統字體; 網頁字型需要明確載入。

解決方案:

<style>
@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap');

body {
    font-family: 'Roboto', Arial, sans-serif;
}
</style>
<style>
@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap');

body {
    font-family: 'Roboto', Arial, sans-serif;
}
</style>
HTML

創新遷移清單

遷移前的任務

審核您的程式碼庫,找出所有Winnovative的用法:

# Find allWinnovativereferences
grep -r "Winnovative" --include="*.cs" .
grep -r "HtmlToPdfConverter" --include="*.cs" .
grep -r "PdfDocumentOptions" --include="*.cs" .
grep -r "ConvertUrl\|ConvertHtml" --include="*.cs" .
# Find allWinnovativereferences
grep -r "Winnovative" --include="*.cs" .
grep -r "HtmlToPdfConverter" --include="*.cs" .
grep -r "PdfDocumentOptions" --include="*.cs" .
grep -r "ConvertUrl\|ConvertHtml" --include="*.cs" .
SHELL

記錄目前的配置,包括頁面大小、邊界和頁首/頁尾設定。 找出可以移除的 CSS 變通方式(webkit 前綴、基於浮動的網格)。 請注意 JavaScript 的相容性要求。

程式碼更新任務

1.移除WinnovativeNuGet 套件 2.安裝 IronPdf NuGet 套件 3.更新所有名稱空間的匯入,從 WinnovativeIronPdf 4.將<編碼>HtmlToPdfConverter</編碼替換為 ChromePdfRenderer 5.將 ConvertHtml() 呼叫轉換為 RenderHtmlAsPdf() 。 6.將 ConvertUrl() 呼叫轉換為 RenderUrlAsPdf() 。 7.更新頁面大小/方向設定至 RenderingOptions 8.轉換邊際配置 9.將基於文字元素的頁首/頁尾轉換為基於 HTML 的 TextHeaderFooter 10.更新頁數占位符,從 &p;/&P; 改為 {page}/{total-pages} 11.在啟動時增加 IronPdf 授權初始化功能

後遷移測試

轉移後,驗證這些方面:

  • 測試基本的 HTML 至 PDF 轉換
  • 測試 URL 至 PDF 的轉換
  • 驗證 CSS 網格佈局是否能正確呈現 (它們現在可以運作了)
  • 驗證 Flexbox 佈局是否能正確呈現 (它們現在可以運作了)
  • 使用現代 ES6+ 語法測試 JavaScript 繁重的頁面
  • 驗證 Bootstrap 5 的相容性
  • 測試頁首/頁尾的呈現
  • 驗證分頁
  • 比較 PDF 輸出品質

清理任務

  • 移除WinnovativeCSS 變通(webkit 前綴)
  • 將 ES5 JavaScript 更新為現代語法
  • 移除基於浮點的網格回退
  • 更新文件

遷移到IronPDF的主要優點。

從Winnovative轉移到IronPDF提供了幾個關鍵的優勢:

現代化的渲染引擎:IronPDF 使用目前的 Chromium 引擎,確保完全支援 CSS3、CSS Grid、Flexbox 和ES2024JavaScript。 Bootstrap 5、Tailwind CSS 和 React/Vue 等現代框架都能正確呈現。

簡化的 API:基於 HTML 的頁首和頁尾取代程式化的文字元素定位。 直觀的占位符如 {page} 會取代晦澀的 &p; 語法。 內建 SaveAs() 方法可免除手動處理位元組。

主動開發:隨著 .NET 10 和 C# 14 的採用增加至 2026 年,IronPDF 的每月更新可確保與目前和未來的 .NET 版本相容。

Modern CSS Without Workarounds:CSS Grid、Flexbox 和現代排版不需要 webkit 前綴或以浮動為基礎的回退。

Modern JavaScript:ES6+ 功能,包括箭頭函數、async/await、類別和模組都能正確執行。

結論

Winnovative 作為 HTML-to-PDF 轉換器服務 .NET 社群,但其依賴 2016 年的 WebKit 引擎,對現代網路開發造成難以克服的挑戰。 CSS Grid 無法運作。 現代 JavaScript 無聲失敗。 Bootstrap 5 和 Tailwind CSS 會產生破壞的佈局。

IronPDF 利用當前的 Chromium 渲染引擎提供現代化的 HTML 至 PDF 轉換。轉換路徑簡單直接:取代 NuGet 套件、更新命名空間、使用映射參考轉換 API 呼叫,以及將基於元素的標頭轉換為基於 HTML 的等效標頭。

立即使用 免費試用 IronPDF 開始您的遷移,並在 PDF 生成中體驗現代化的 CSS 和 JavaScript 支援。

如需全面的實施指導,請瀏覽 IronPdf文件教學,以及API參考

Curtis Chau
技術作家

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

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