跳至頁尾內容
產品比較

IronPDF vs Accusoft PDF Viewer:哪個 C# 程式庫最適合 HTML 到 PDF?

IronPDF 和 Accusoft PDF Viewer 皆可在 .NET 環境中將 HTML 轉換為 PDF。 IronPDF 提供直觀的語法、無需依賴雲端的本地處理功能,且無限制轉換服務起價為 $699。相較之下,Accusoft 則需要網路連線,並按交易次數收費。

比較 IronPDF 與 Accusoft PDF Viewer

  • 將 HTML 轉換為 PDF
  • 為 PDF 設定頁首與頁尾
  • 將 PDF 轉換為影像檔案
  • 比較授權、免費試用選項等

概述

什麼是 IronPDF,它是如何運作的?

IronPDF 是一款 C# HTML 轉 PDF 函式庫,讓開發人員能夠 HTML 字串網頁 (WebPage) 和 URL來源建立 PDF 檔案。 它還允許設定水印書籤頁首和頁尾等屬性。 此外,開發人員可將多個 PDF 檔案合併為一個檔案,或將 PDF 頁面轉換為圖片,亦可透過圖片轉 PDF 功能進行反向轉換

IronPDF 提供免費開發版本,並針對實際專案提供 30 天試用期。 它提供完整的文件程式碼範例API 參考,以協助開發者快速上手。

Developers can download a file project from this link.

What Is Accusoft `PrizmDoc` Viewer and How Does It Work?

PrizmDoc Viewer 是一項 REST API,可處理 PDF 檔案並遠端將其轉換為其他格式。 PrizmDoc 可以將 100 多種不同的檔案格式轉換為 PDF,以及將 PDF 轉換為PNG、JPGTIFF和 SVG。 此外,它還為應用程式提供多種電子簽名選項

How Do IronPDF and `PrizmDoc` Viewer Compare?

IronPDF `PrizmDoc` Viewer
Work with [PDF files programmatically](/how-to/csharp-parse-pdf/). 程式化處理 PDF 檔案。
Supports [.NET Core](/docs/) with [Windows](/get-started/windows/), [Mac](/get-started/macos/), or [Linux](/get-started/linux/). 支援使用 Windows、Mac 或 Linux 的 .NET Core。
[Works Locally](/get-started/installation-overview/) Sends Documents to a [remote server](/get-started/ironpdfengine/).
Work with or without [Asynchronous Programming](/how-to/async/). Must use Asynchronous Programming with `System.Threading.Tasks`.
Works offline once [installed](/get-started/installation-overview/). Requires internet connection for `PrizmDoc` server requests.
Provides many [predefined functions](/features/). 提供一些預先定義的功能。
Often requires [minimal lines of code](/tutorials/html-to-pdf/). 通常需要許多行的程式碼。
[Unlimited conversions](/licensing/) per project in each license. 雲端託管授權的交易數量有限。
[Free for development](/get-started/quickstart/) without time limits. 試用版僅有 300 宗交易。

讓我們安裝這兩套函式庫,並比較程式碼。


步驟 1:安裝

如何在我的.NET專案中安裝IronPDF?

在專案中安裝 IronPDF 有兩種方法,兩者之間並無差異。 IronPDF 支援多種環境,包括 Azure 部署AWS LambdaDocker 容器Blazor 應用程式

有哪些不同的方式可以下載 IronPDF?

下載 IronPDF.dll 並將其引用加入專案中。 開發人員亦可使用 Windows Installer 進行全系統安裝。 完成後,即可透過以下方式存取 IronPdf 命名空間:

using IronPdf;
using IronPdf;
Imports IronPdf
$vbLabelText   $csharpLabel

現在,開發人員可以輕鬆存取 IronPDF 提供的各項功能與類別,包括用於渲染的 ChromePdfRendererPDF 文件操作功能,以及安全性功能

如何透過 NuGet 套件管理員安裝 IronPDF?

  • 套件管理員控制台:

    若使用套件管理主控台,請執行以下指令:

    _CODEBLOCK1

  • 管理解決方案的套件:

    若使用 NuGet 套件管理員的圖形化介面,請在搜尋列中輸入"IronPDF"並進行安裝。 如需進階安裝選項(包括適用於 LinuxmacOSWindows 的平台專用套件),請參閱安裝指南


How Do I Install `PrizmDoc` Viewer from Accusoft?

PrizmDoc Viewer 由兩部分組成:伺服器端元件 PrizmDoc Server,它作為 RESTful API 運行;以及客戶端項目,它向 API 發送請求並接收回應。 與無需外部依賴即可在本地運行的 IronPDF 不同,PrizmDoc 需要網路連線才能進行基於雲端的操作。

How Can I Access the `PrizmDoc` Server?

PrizmDoc 伺服器是一個伺服器端應用程序,它接收包含文件的基本資訊作為請求(輸入),並將文件轉換為PDF 文件,然後將轉換後的 PDF 文件作為回應(輸出)發送回去。 它作為產品的技術核心——一個文件處理與轉換引擎。開發人員可透過兩種不同方法使用它,兩者皆採用相同的程式設計架構與技術:

1.自助式:

此選項需要配置伺服器。 請下載 PrizmDoc Server 並進行安裝。 閱讀更多關於如何在 Windows 上安裝 PrizmDoc 伺服器的資訊。

注意:為提升效能,系統需具備至少 32 GB 記憶體及 4 核心處理器。 相較之下,IronPDF 的系統需求則低得多。

2.雲端託管:

這項基於雲端的服務讓您無需自行架設伺服器。 若要使用此選項,請建立帳戶,然後從主頁上的 API Key 選單複製 API key

首先,讓我們來了解一下使用 PrizmDoc Viewer 將文件轉換為 PDF 文件的基本結構,方法是在 C# 控制台應用程式中使用 WebClient() 直接與 Accusoft server 進行互動。

注意:以下範例示範了 PrizmDoc 如何處理 PDF 檔案。 由於內容較長,您可跳過此範例,直接閱讀後續的比較內容

Accusoft 的運作架構如何運作?

此範例將 myWebpage.html 轉換為 sample.pdf。 與IronPDF 直接的 HTML 到 PDF 轉換不同,PrizmDoc 需要多次 API 呼叫。

注意:必須安裝 Newtonsoft.Json 庫並在專案中引用它。

首先,請將以下函式庫新增至專案中:

using System;
using System.IO;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq; // Install Newtonsoft.Json via NuGet Package Manager
using System;
using System.IO;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq; // Install Newtonsoft.Json via NuGet Package Manager
Imports System
Imports System.IO
Imports System.Net
Imports System.Text
Imports System.Threading.Tasks
Imports Newtonsoft.Json.Linq ' Install Newtonsoft.Json via NuGet Package Manager
$vbLabelText   $csharpLabel

然後建立一個名為 Accusoft API Key 的公共變量,並將 API 金鑰貼到其中:

static string ApiKey = "Your-API-KEY";
static string ApiKey = "Your-API-KEY";
Private Shared ApiKey As String = "Your-API-KEY"
$vbLabelText   $csharpLabel

使用 PrizmDoc Viewer 處理 PDF 檔案需要 3 個步驟:

  1. 將檔案上傳至 PrizmDoc 伺服器。 2.轉換上傳的檔案。
  2. PrizmDoc 伺服器下載轉換後的檔案。

每個步驟由獨立的函式處理:

static void Main(string[] args)
{
    //---Upload file to Server---
    JObject uploadResults = UploadToServer("myWebpage.html").Result;
    string fileID = (string)uploadResults.SelectToken("fileId");
    string affinityToken = (string)uploadResults.SelectToken("affinityToken");

    //---Convert the uploaded file to PDF---
    JObject convertResults = Convert(affinityToken, fileID).Result;
    string processId = (string)convertResults.SelectToken("processId");
    affinityToken = (string)convertResults.SelectToken("affinityToken");

    //---Check the status that conversion is completed---
    JObject convertStatusResults = ConvertStatus(processId, affinityToken).Result;
    string convertStatus = (string)convertStatusResults.SelectToken("state");

    //---Continuously checking whether conversion completed---
    while (!(convertStatus.Equals("complete")))
    {
        System.Threading.Thread.Sleep(30000);
        convertStatusResults = ConvertStatus(processId, affinityToken).Result;
        convertStatus = (string)convertStatusResults.SelectToken("state");
    }

    //---Download the converted file from server---
    string newFileID = (string)convertStatusResults.SelectToken("output.results[0].fileId");
    DownloadFromServer(affinityToken, newFileID, "sample.pdf").Wait();

    Console.WriteLine("PDF file created successfully...!");
    Console.ReadKey();
}
static void Main(string[] args)
{
    //---Upload file to Server---
    JObject uploadResults = UploadToServer("myWebpage.html").Result;
    string fileID = (string)uploadResults.SelectToken("fileId");
    string affinityToken = (string)uploadResults.SelectToken("affinityToken");

    //---Convert the uploaded file to PDF---
    JObject convertResults = Convert(affinityToken, fileID).Result;
    string processId = (string)convertResults.SelectToken("processId");
    affinityToken = (string)convertResults.SelectToken("affinityToken");

    //---Check the status that conversion is completed---
    JObject convertStatusResults = ConvertStatus(processId, affinityToken).Result;
    string convertStatus = (string)convertStatusResults.SelectToken("state");

    //---Continuously checking whether conversion completed---
    while (!(convertStatus.Equals("complete")))
    {
        System.Threading.Thread.Sleep(30000);
        convertStatusResults = ConvertStatus(processId, affinityToken).Result;
        convertStatus = (string)convertStatusResults.SelectToken("state");
    }

    //---Download the converted file from server---
    string newFileID = (string)convertStatusResults.SelectToken("output.results[0].fileId");
    DownloadFromServer(affinityToken, newFileID, "sample.pdf").Wait();

    Console.WriteLine("PDF file created successfully...!");
    Console.ReadKey();
}
Shared Sub Main(ByVal args() As String)
	'---Upload file to Server---
	Dim uploadResults As JObject = UploadToServer("myWebpage.html").Result
	Dim fileID As String = CStr(uploadResults.SelectToken("fileId"))
	Dim affinityToken As String = CStr(uploadResults.SelectToken("affinityToken"))

	'---Convert the uploaded file to PDF---
	Dim convertResults As JObject = Convert(affinityToken, fileID).Result
	Dim processId As String = CStr(convertResults.SelectToken("processId"))
	affinityToken = CStr(convertResults.SelectToken("affinityToken"))

	'---Check the status that conversion is completed---
	Dim convertStatusResults As JObject = ConvertStatus(processId, affinityToken).Result
	Dim convertStatus As String = CStr(convertStatusResults.SelectToken("state"))

	'---Continuously checking whether conversion completed---
	Do While Not (convertStatus.Equals("complete"))
		System.Threading.Thread.Sleep(30000)
		convertStatusResults = ConvertStatus(processId, affinityToken).Result
		convertStatus = CStr(convertStatusResults.SelectToken("state"))
	Loop

	'---Download the converted file from server---
	Dim newFileID As String = CStr(convertStatusResults.SelectToken("output.results[0].fileId"))
	DownloadFromServer(affinityToken, newFileID, "sample.pdf").Wait()

	Console.WriteLine("PDF file created successfully...!")
	Console.ReadKey()
End Sub
$vbLabelText   $csharpLabel

1.將檔案上傳至伺服器:2.

public static async Task<JObject> UploadToServer(string fileToUpload)
{
    FileInfo input = new FileInfo(fileToUpload);
    if (input == null)
    {
        throw new ArgumentException("Missing parameter input", nameof(input));
    }
    var fileName = input.Name;
    var endpoint = new Uri("___PROTECTED_URL_123___");
    using (var client = new WebClient())
    {
        client.Headers.Add("acs-api-key", ApiKey);
        client.Headers.Add("Content-Type", "application/octet-stream");
        using (var reader = new BinaryReader(input.OpenRead()))
        {
            var data = reader.ReadBytes((int)reader.BaseStream.Length);
            var results = await client.UploadDataTaskAsync(endpoint, "POST", data);
            string getResult = Encoding.ASCII.GetString(results);
            return JObject.Parse(getResult);
        }
    }
}
public static async Task<JObject> UploadToServer(string fileToUpload)
{
    FileInfo input = new FileInfo(fileToUpload);
    if (input == null)
    {
        throw new ArgumentException("Missing parameter input", nameof(input));
    }
    var fileName = input.Name;
    var endpoint = new Uri("___PROTECTED_URL_123___");
    using (var client = new WebClient())
    {
        client.Headers.Add("acs-api-key", ApiKey);
        client.Headers.Add("Content-Type", "application/octet-stream");
        using (var reader = new BinaryReader(input.OpenRead()))
        {
            var data = reader.ReadBytes((int)reader.BaseStream.Length);
            var results = await client.UploadDataTaskAsync(endpoint, "POST", data);
            string getResult = Encoding.ASCII.GetString(results);
            return JObject.Parse(getResult);
        }
    }
}
Public Shared Async Function UploadToServer(fileToUpload As String) As Task(Of JObject)
    Dim input As New FileInfo(fileToUpload)
    If input Is Nothing Then
        Throw New ArgumentException("Missing parameter input", NameOf(input))
    End If

    Dim fileName = input.Name
    Dim endpoint As New Uri("___PROTECTED_URL_123___")
    Using client As New WebClient()
        client.Headers.Add("acs-api-key", ApiKey)
        client.Headers.Add("Content-Type", "application/octet-stream")
        Using reader As New BinaryReader(input.OpenRead())
            Dim data = reader.ReadBytes(CInt(reader.BaseStream.Length))
            Dim results = Await client.UploadDataTaskAsync(endpoint, "POST", data)
            Dim getResult As String = Encoding.ASCII.GetString(results)
            Return JObject.Parse(getResult)
        End Using
    End Using
End Function
$vbLabelText   $csharpLabel

2.將上傳的檔案轉換為 PDF:

public static async Task<JObject> Convert(string affinityToken, string fileID)
{
    var endpoint = new Uri("___PROTECTED_URL_124___");
    using (var client = new WebClient())
    {
        client.Headers.Add("Content-Type", "application/json");
        client.Headers.Add("acs-api-key", ApiKey);
        client.Headers.Add("Accusoft-Affinity-Token", affinityToken);
        JObject myJson =
            new JObject(
                new JProperty("input",
                    new JObject(
                        new JProperty("sources",
                            new JArray(
                                new JObject(
                                    new JProperty("fileId", fileID)
                                )
                            )
                        ),
                        new JProperty("dest",
                            new JObject(
                                new JProperty("format", "pdf")
                            )
                        )
                    )
                )
            );
        string results = await client.UploadStringTaskAsync(endpoint, "POST", myJson.ToString());
        return JObject.Parse(results);
    }
}
public static async Task<JObject> Convert(string affinityToken, string fileID)
{
    var endpoint = new Uri("___PROTECTED_URL_124___");
    using (var client = new WebClient())
    {
        client.Headers.Add("Content-Type", "application/json");
        client.Headers.Add("acs-api-key", ApiKey);
        client.Headers.Add("Accusoft-Affinity-Token", affinityToken);
        JObject myJson =
            new JObject(
                new JProperty("input",
                    new JObject(
                        new JProperty("sources",
                            new JArray(
                                new JObject(
                                    new JProperty("fileId", fileID)
                                )
                            )
                        ),
                        new JProperty("dest",
                            new JObject(
                                new JProperty("format", "pdf")
                            )
                        )
                    )
                )
            );
        string results = await client.UploadStringTaskAsync(endpoint, "POST", myJson.ToString());
        return JObject.Parse(results);
    }
}
Public Shared Async Function Convert(affinityToken As String, fileID As String) As Task(Of JObject)
    Dim endpoint = New Uri("___PROTECTED_URL_124___")
    Using client = New WebClient()
        client.Headers.Add("Content-Type", "application/json")
        client.Headers.Add("acs-api-key", ApiKey)
        client.Headers.Add("Accusoft-Affinity-Token", affinityToken)
        Dim myJson As JObject =
            New JObject(
                New JProperty("input",
                    New JObject(
                        New JProperty("sources",
                            New JArray(
                                New JObject(
                                    New JProperty("fileId", fileID)
                                )
                            )
                        ),
                        New JProperty("dest",
                            New JObject(
                                New JProperty("format", "pdf")
                            )
                        )
                    )
                )
            )
        Dim results As String = Await client.UploadStringTaskAsync(endpoint, "POST", myJson.ToString())
        Return JObject.Parse(results)
    End Using
End Function
$vbLabelText   $csharpLabel

以下 JSON 是 myJson 物件的回傳值:

{
  "input": {
    "sources": 
    [
      {"fileId": "Auto Generated FileId Value"}
    ],
    "dest": {
      "format": "pdf"
    }
  }
}

檢查轉換是否完成

public static async Task<JObject> ConvertStatus(string processId, string affinityToken)
{
    string endpoint = "___PROTECTED_URL_125___" + processId;
    using (var client = new WebClient())
    {
        client.BaseAddress = endpoint;
        client.Headers.Add("acs-api-key", ApiKey);
        client.Headers.Add("Accusoft-Affinity-Token", affinityToken);
        string results = await client.DownloadStringTaskAsync(endpoint);
        return JObject.Parse(results);
    }
}
public static async Task<JObject> ConvertStatus(string processId, string affinityToken)
{
    string endpoint = "___PROTECTED_URL_125___" + processId;
    using (var client = new WebClient())
    {
        client.BaseAddress = endpoint;
        client.Headers.Add("acs-api-key", ApiKey);
        client.Headers.Add("Accusoft-Affinity-Token", affinityToken);
        string results = await client.DownloadStringTaskAsync(endpoint);
        return JObject.Parse(results);
    }
}
Public Shared Async Function ConvertStatus(processId As String, affinityToken As String) As Task(Of JObject)
    Dim endpoint As String = "___PROTECTED_URL_125___" & processId
    Using client As New WebClient()
        client.BaseAddress = endpoint
        client.Headers.Add("acs-api-key", ApiKey)
        client.Headers.Add("Accusoft-Affinity-Token", affinityToken)
        Dim results As String = Await client.DownloadStringTaskAsync(endpoint)
        Return JObject.Parse(results)
    End Using
End Function
$vbLabelText   $csharpLabel

3.從伺服器下載轉換後的檔案

public static async Task DownloadFromServer(string affinityToken, string fileId, string outfile)
{
    var endpoint = new Uri("___PROTECTED_URL_126___" + fileId);

    using (var client = new WebClient())
    {
        client.Headers.Add("acs-api-key", ApiKey);
        client.Headers.Add("Accusoft-Affinity-Token", affinityToken);
        FileInfo output = new FileInfo(outfile);

        using (var writeStream = output.Create())
        {
            var results = await client.DownloadDataTaskAsync(endpoint);
            await writeStream.WriteAsync(results, 0, results.Length);
        }
    }
}
public static async Task DownloadFromServer(string affinityToken, string fileId, string outfile)
{
    var endpoint = new Uri("___PROTECTED_URL_126___" + fileId);

    using (var client = new WebClient())
    {
        client.Headers.Add("acs-api-key", ApiKey);
        client.Headers.Add("Accusoft-Affinity-Token", affinityToken);
        FileInfo output = new FileInfo(outfile);

        using (var writeStream = output.Create())
        {
            var results = await client.DownloadDataTaskAsync(endpoint);
            await writeStream.WriteAsync(results, 0, results.Length);
        }
    }
}
Public Shared Async Function DownloadFromServer(affinityToken As String, fileId As String, outfile As String) As Task
    Dim endpoint As New Uri("___PROTECTED_URL_126___" & fileId)

    Using client As New WebClient()
        client.Headers.Add("acs-api-key", ApiKey)
        client.Headers.Add("Accusoft-Affinity-Token", affinityToken)
        Dim output As New FileInfo(outfile)

        Using writeStream As FileStream = output.Create()
            Dim results As Byte() = Await client.DownloadDataTaskAsync(endpoint)
            Await writeStream.WriteAsync(results, 0, results.Length)
        End Using
    End Using
End Function
$vbLabelText   $csharpLabel

上述範例需要投入相當大的心力。 為了最大限度地減少工作量,Accusoft 推出了一個名為Accusoft.PrizmDocServerSDK的 .NET 函式庫,它是 PrizmDoc 伺服器 REST API 的封裝。 讓我們來看看如何在 .NET 專案中安裝並使用此函式庫。

How Do I Install Accusoft.`PrizmDocServer`SDK?

有兩種安裝 wrapper 的方式。

  • 套件管理員控制台:

    若使用套件管理主控台,請執行以下指令:

    _CODEBLOCK10

  • 管理解決方案的套件:

    如果使用 NuGet 套件管理器 GUI,請在搜尋欄中瀏覽 Accusoft.PrizmDocServerSDK 並安裝它。

現在,開發者可以輕鬆存取並使用該命名空間:

using Accusoft.PrizmDocServer;
using Accusoft.PrizmDocServer;
Imports Accusoft.PrizmDocServer
$vbLabelText   $csharpLabel

如何教學

IronPDF 和 PrizmDoc Viewer 在程式碼範例中有何異同?

在詳閱兩項元件的簡介與安裝說明後,現在是時候開始實際運用它們了。 以下使用案例展示了如何結合使用這兩項元件,以協助理解程式設計架構,並判斷哪種方案最符合專案需求。


如何使用 IronPDF 而不是 PrizmDoc Viewer 將 HTML 轉換為 PDF?

為了進行比較,讓我們將名為 myWebPage.html 的網頁轉換為PDF 檔案並將其儲存到目標位置。 IronPDF 的 Chrome 渲染引擎提供像素級精準的轉換,並全面支援 CSSJavaScript網頁字型

IronPDF 是如何將 HTML 轉換為 PDF 的?

using IronPdf;

static void Main(string[] args)
{
    // Create rendering converter
    var converter = new ChromePdfRenderer();
    // Render HTML file to PDF
    using var PDF = converter.RenderHTMLFileAsPdf("myWebPage.html");
    // Save to target location
    PDF.SaveAs("sample.pdf");
}
using IronPdf;

static void Main(string[] args)
{
    // Create rendering converter
    var converter = new ChromePdfRenderer();
    // Render HTML file to PDF
    using var PDF = converter.RenderHTMLFileAsPdf("myWebPage.html");
    // Save to target location
    PDF.SaveAs("sample.pdf");
}
Imports IronPdf

Shared Sub Main(ByVal args() As String)
	' Create rendering converter
	Dim converter = New ChromePdfRenderer()
	' Render HTML file to PDF
	Dim PDF = converter.RenderHTMLFileAsPdf("myWebPage.html")
	' Save to target location
	PDF.SaveAs("sample.pdf")
End Sub
$vbLabelText   $csharpLabel

上面的程式碼建立了一個 sample.pdf 文件,並將其儲存到專案的bin>debug資料夾中。 IronPDF 亦支援 HTML 字串、URL,甚至包含 HTML 的 ZIP 檔案作為輸入來源。

開發者也可以像這樣指定任何路徑:PDF.SaveAs("E:/sample.pdf");,或儲存到記憶體流中以進行雲端部署。

進一步了解如何運用 IronPDF 處理 PDF 檔案。

現在,讓我們使用 PrizmDoc Viewer 執行相同的任務進行比較。

PrizmDoc Viewer 如何將 HTML 轉換為 PDF?

PrizmDoc Viewer 安裝部分中討論如何取得 Accusoft API Key。 以下是使用方法。

首先,向 PrizmDoc 伺服器發送請求並接收回應。 此過程需要時間,因此需採用非同步程式設計。 IronPDF 亦支援非同步方法以提升效能。

注意:使用 PrizmDoc Viewer 的雲端服務建立 PDF 檔案時,請確保系統已連接至網際網路。

using Accusoft.PrizmDocServer;
using Accusoft.PrizmDocServer.Conversion;

static void Main(string[] args)
{
    ChromePdfRenderer().GetAwaiter().GetResult();
}

private static async Task ChromePdfRenderer()
{
    // Instantiate PrizmDocServerClient object
    var prizmDocServer = new PrizmDocServerClient("___PROTECTED_URL_127___", "Your-API-KEY");
    // Specify HTML file and convert it to a PDF.
    ConversionResult result = await prizmDocServer.ConvertToPdfAsync("myWebPage.html");
    // Save PDF file to the target location
    await result.RemoteWorkFile.SaveAsync("sample.pdf");
}
using Accusoft.PrizmDocServer;
using Accusoft.PrizmDocServer.Conversion;

static void Main(string[] args)
{
    ChromePdfRenderer().GetAwaiter().GetResult();
}

private static async Task ChromePdfRenderer()
{
    // Instantiate PrizmDocServerClient object
    var prizmDocServer = new PrizmDocServerClient("___PROTECTED_URL_127___", "Your-API-KEY");
    // Specify HTML file and convert it to a PDF.
    ConversionResult result = await prizmDocServer.ConvertToPdfAsync("myWebPage.html");
    // Save PDF file to the target location
    await result.RemoteWorkFile.SaveAsync("sample.pdf");
}
Imports Accusoft.PrizmDocServer
Imports Accusoft.PrizmDocServer.Conversion

Module Program
    Sub Main(args As String())
        ChromePdfRenderer().GetAwaiter().GetResult()
    End Sub

    Private Async Function ChromePdfRenderer() As Task
        ' Instantiate PrizmDocServerClient object
        Dim prizmDocServer = New PrizmDocServerClient("___PROTECTED_URL_127___", "Your-API-KEY")
        ' Specify HTML file and convert it to a PDF.
        Dim result As ConversionResult = Await prizmDocServer.ConvertToPdfAsync("myWebPage.html")
        ' Save PDF file to the target location
        Await result.RemoteWorkFile.SaveAsync("sample.pdf")
    End Function
End Module
$vbLabelText   $csharpLabel

閱讀更多關於使用 PrizmDoc Viewer 的資訊。

哪個函式庫能提供更簡易的 HTML 轉 PDF 功能?

這些範例說明 IronPDF 提供了一種更簡便的 PDF 檔案建立方式,且所需時間更少。IronPDF 還提供渲染選項以微調輸出效果,包括自訂紙張尺寸邊距視口設定


如何使用 IronPDF 而不是 PrizmDoc Viewer 將影像轉換為 PDF?

此比較示範如何從位於專案 debug 資料夾中的影像建立 PDF 檔案。 開發者從 IronPDF 開始。

IronPDF 是如何將圖片轉換為 PDF 的?

using IronPdf;

static void Main(string[] args)
{
    // Specify the image to be converted
    using var converted = ImageToPdfConverter.ImageToPdf("google.png");
    // Save PDF file to the target location
    converted.SaveAs("sample.pdf");
}
using IronPdf;

static void Main(string[] args)
{
    // Specify the image to be converted
    using var converted = ImageToPdfConverter.ImageToPdf("google.png");
    // Save PDF file to the target location
    converted.SaveAs("sample.pdf");
}
Imports IronPdf

Shared Sub Main(ByVal args() As String)
	' Specify the image to be converted
	Dim converted = ImageToPdfConverter.ImageToPdf("google.png")
	' Save PDF file to the target location
	converted.SaveAs("sample.pdf")
End Sub
$vbLabelText   $csharpLabel

IronPDF 亦支援多幀 TIFF 轉換嵌入來自 Azure Blob Storage 的圖片,以及 Base64 圖片嵌入

輸出:

此螢幕截圖顯示了使用上述程式碼新建立的 PDF 檔案 sample.pdf

一份PDF文檔,其中谷歌徽標居中顯示在白色背景上,演示了IronPDF的圖像轉PDF功能。

使用 IronPDF 從圖片建立 PDF 檔案的步驟相當簡單。 現在,讓我們使用 PrizmDoc Viewer 執行相同的任務,並檢查其產生的 PDF 檔案。

PrizmDoc Viewer 如何將影像轉換為 PDF?

using Accusoft.PrizmDocServer;
using Accusoft.PrizmDocServer.Conversion;

static void Main(string[] args)
{
    ImageToPDF().GetAwaiter().GetResult();
}

private static async Task ImageToPDF()
{
    // Instantiate PrizmDocServerClient object
    var prizmDocServer = new PrizmDocServerClient("___PROTECTED_URL_128___", "Your-API-KEY");
    // Specify the image to be converted
    ConversionResult results = await prizmDocServer.ConvertToPdfAsync("google.png");
    // Save PDF file to the target location
    await results.RemoteWorkFile.SaveAsync("sample.pdf");
}
using Accusoft.PrizmDocServer;
using Accusoft.PrizmDocServer.Conversion;

static void Main(string[] args)
{
    ImageToPDF().GetAwaiter().GetResult();
}

private static async Task ImageToPDF()
{
    // Instantiate PrizmDocServerClient object
    var prizmDocServer = new PrizmDocServerClient("___PROTECTED_URL_128___", "Your-API-KEY");
    // Specify the image to be converted
    ConversionResult results = await prizmDocServer.ConvertToPdfAsync("google.png");
    // Save PDF file to the target location
    await results.RemoteWorkFile.SaveAsync("sample.pdf");
}
Imports Accusoft.PrizmDocServer
Imports Accusoft.PrizmDocServer.Conversion

Module Module1

    Sub Main()
        ImageToPDF().GetAwaiter().GetResult()
    End Sub

    Private Async Function ImageToPDF() As Task
        ' Instantiate PrizmDocServerClient object
        Dim prizmDocServer As New PrizmDocServerClient("___PROTECTED_URL_128___", "Your-API-KEY")
        ' Specify the image to be converted
        Dim results As ConversionResult = Await prizmDocServer.ConvertToPdfAsync("google.png")
        ' Save PDF file to the target location
        Await results.RemoteWorkFile.SaveAsync("sample.pdf")
    End Function

End Module
$vbLabelText   $csharpLabel

輸出:此螢幕截圖顯示了上述程式碼新建立的 PDF 檔案 sample.pdf

PDF viewer displaying the Google logo on a gray background, showing `PrizmDoc`'s image conversion result

哪個函式庫在將圖片轉換為 PDF 時所需的程式碼較少?

IronPDF 僅需兩行程式碼。 相比之下,使用 PrizmDoc 伺服器需要編寫更多非同步程式碼。 IronPDF 的輸出結果還會自動提供一份可用的全頁文件。 IronPDF 提供額外的圖片定位選項及多張圖片轉換功能


如何使用 IronPDF 而不是 PrizmDoc Viewer 合併多個 PDF 檔案?

為了進行比較,假設存在三個 PDF 文件,分別命名為 A.pdfB.pdfC.pdf。 任務是將它們合併成一個PDF檔案。 這兩個元件都能執行此任務。 首先,此範例展示如何使用 IronPDF 執行此操作。

IronPDF如何合併PDF文件?

using IronPdf;
using System.Collections.Generic;

static void Main(string[] args)
{
    // Create rendering converter  
    var Renderer = new IronPdf.ChromePdfRenderer();
    // Create a list of pdf files
    var PDFs = new List<PdfDocument>();
    PDFs.Add(PdfDocument.FromFile("A.pdf"));
    PDFs.Add(PdfDocument.FromFile("B.pdf"));
    PDFs.Add(PdfDocument.FromFile("C.pdf"));
    // Merge the list of pdf file
    using PdfDocument PDF = PdfDocument.Merge(PDFs);
    // Save merged file to the target location
    PDF.SaveAs("sample.pdf");

    foreach(var pdf in PDFs)
    {
        pdf.Dispose();
    }
}
using IronPdf;
using System.Collections.Generic;

static void Main(string[] args)
{
    // Create rendering converter  
    var Renderer = new IronPdf.ChromePdfRenderer();
    // Create a list of pdf files
    var PDFs = new List<PdfDocument>();
    PDFs.Add(PdfDocument.FromFile("A.pdf"));
    PDFs.Add(PdfDocument.FromFile("B.pdf"));
    PDFs.Add(PdfDocument.FromFile("C.pdf"));
    // Merge the list of pdf file
    using PdfDocument PDF = PdfDocument.Merge(PDFs);
    // Save merged file to the target location
    PDF.SaveAs("sample.pdf");

    foreach(var pdf in PDFs)
    {
        pdf.Dispose();
    }
}
Imports IronPdf
Imports System.Collections.Generic

Shared Sub Main(ByVal args() As String)
	' Create rendering converter  
	Dim Renderer = New IronPdf.ChromePdfRenderer()
	' Create a list of pdf files
	Dim PDFs = New List(Of PdfDocument)()
	PDFs.Add(PdfDocument.FromFile("A.pdf"))
	PDFs.Add(PdfDocument.FromFile("B.pdf"))
	PDFs.Add(PdfDocument.FromFile("C.pdf"))
	' Merge the list of pdf file
	Using PDF As PdfDocument = PdfDocument.Merge(PDFs)
		' Save merged file to the target location
		PDF.SaveAs("sample.pdf")
	
'INSTANT VB NOTE: The variable pdf was renamed since Visual Basic will not allow local variables with the same name as parameters or other local variables:
		For Each .pdf_Conflict In PDFs
			.pdf_Conflict.Dispose()
		Next pdf_Conflict
	End Using
End Sub
$vbLabelText   $csharpLabel

上面的程式碼建立了一個名為 sample.pdf 的文件,該文件合併了 A.pdfB.pdfC.pdf。 IronPDF 也支援在 PDF 之間新增和複製頁面以及分割 PDF

現在,讓我們使用 PrizmDoc Viewer 執行相同的任務。

PrizmDoc Viewer 如何合併 PDF 檔案?

using System.Threading.Tasks;
using Accusoft.PrizmDocServer;
using Accusoft.PrizmDocServer.Conversion;

static void Main(string[] args)
{
    PdfMerge().GetAwaiter().GetResult();
}

private static async Task PdfMerge()
{
    // Instantiate PrizmDocServerClient object
    var prizmDocServer = new PrizmDocServerClient("___PROTECTED_URL_129___", "Your-API-KEY");
    // Pass the list of pdf files to PrizmDoc Server
    ConversionResult result = await prizmDocServer.CombineToPdfAsync(
        new []
        {
            new ConversionSourceDocument("A.pdf"),
            new ConversionSourceDocument("B.pdf"),
            new ConversionSourceDocument("C.pdf"),
        });
    // Save merged file to the target location
    await result.RemoteWorkFile.SaveAsync("sample.pdf");
}
using System.Threading.Tasks;
using Accusoft.PrizmDocServer;
using Accusoft.PrizmDocServer.Conversion;

static void Main(string[] args)
{
    PdfMerge().GetAwaiter().GetResult();
}

private static async Task PdfMerge()
{
    // Instantiate PrizmDocServerClient object
    var prizmDocServer = new PrizmDocServerClient("___PROTECTED_URL_129___", "Your-API-KEY");
    // Pass the list of pdf files to PrizmDoc Server
    ConversionResult result = await prizmDocServer.CombineToPdfAsync(
        new []
        {
            new ConversionSourceDocument("A.pdf"),
            new ConversionSourceDocument("B.pdf"),
            new ConversionSourceDocument("C.pdf"),
        });
    // Save merged file to the target location
    await result.RemoteWorkFile.SaveAsync("sample.pdf");
}
Imports System.Threading.Tasks
Imports Accusoft.PrizmDocServer
Imports Accusoft.PrizmDocServer.Conversion

Module Module1
    Sub Main()
        PdfMerge().GetAwaiter().GetResult()
    End Sub

    Private Async Function PdfMerge() As Task
        ' Instantiate PrizmDocServerClient object
        Dim prizmDocServer = New PrizmDocServerClient("___PROTECTED_URL_129___", "Your-API-KEY")
        ' Pass the list of pdf files to PrizmDoc Server
        Dim result As ConversionResult = Await prizmDocServer.CombineToPdfAsync(
            New ConversionSourceDocument() {
                New ConversionSourceDocument("A.pdf"),
                New ConversionSourceDocument("B.pdf"),
                New ConversionSourceDocument("C.pdf")
            })
        ' Save merged file to the target location
        Await result.RemoteWorkFile.SaveAsync("sample.pdf")
    End Function
End Module
$vbLabelText   $csharpLabel

上述程式碼也會建立一個 sample.pdf 文件,該文件合併了 A.pdfB.pdfC.pdf 檔案。


如何使用 IronPDF 和 PrizmDoc Viewer 為 PDF 新增頁首和頁尾?

為了進行比較,假設存在一個名為 @@--CODE-15062--@@ 的簡單 @@--CODE-15061--@@,其 HTML 和 CSS 程式碼如下:

<html>
<head>
    <style>
        li {
            font-size: x-large;
            color: rgba(156, 89, 13, 0.897);
            list-style: square;
        }
    </style>
</head>
<body>
    <h1 style="text-align: center;">Hello World..!</h1>
    <h1>Main Menu</h1>
    <ul>
        <li>SubMenu 1</li>
        <li>SubMenu 2</li>
        <li>SubMenu 3</li>
        <li>SubMenu 4</li>
        <li>SubMenu 5</li>
    </ul>
</body>
</html>
<html>
<head>
    <style>
        li {
            font-size: x-large;
            color: rgba(156, 89, 13, 0.897);
            list-style: square;
        }
    </style>
</head>
<body>
    <h1 style="text-align: center;">Hello World..!</h1>
    <h1>Main Menu</h1>
    <ul>
        <li>SubMenu 1</li>
        <li>SubMenu 2</li>
        <li>SubMenu 3</li>
        <li>SubMenu 4</li>
        <li>SubMenu 5</li>
    </ul>
</body>
</html>
HTML

目標是將此 WebPage 轉換為具有以下頁首和頁尾屬性的 PDF 檔案:

  • 標題左側的 Page Title
  • 標題右側的 DateTime
  • 頁腳右側的 Page Number of Total Pages

首先,讓我們來看看 IronPDF 是如何處理頁首和頁尾的。

IronPDF 如何處理 PDF 的頁首和頁尾?

為了處理 PDF 檔案的頁首和頁腳,IronPDF 在 ChromePdfRenderer 類別上提供了一個名為 RenderingOptions 的屬性,其用法如下:

  • 適用於標題:

    _CODEBLOCK19

  • 適用於頁腳:

    _CODEBLOCK20

初始化 TextHeaderFooter() 時,可設定下列屬性:

  • CenterText用於在頁首或頁尾中心列印文本
  • LeftText用於在頁首或頁尾左側列印文本
  • RightText用於在頁首或頁尾右側列印文本
  • DrawDividerLine繪製一條線,將頁面內容與頁首或頁尾分隔開
  • FontFamily指定頁首或頁尾的字型系列
  • FontSize用於指定頁首或頁尾的字體大小 *間距調整頁面內容與頁首或頁尾之間的空間

以下預定義屬性有助於設定頁首或頁尾內容。 它們寫在花括號裡 { }:

  • {page}在頁首或頁尾列印目前頁碼
  • {total-pages}在頁首或頁尾列印總頁數
  • {url}會列印渲染後頁面的 URL
  • {date}在頁首或頁尾中列印目前日期
  • {time}在頁首或頁尾列印目前時間
  • {html-title}在頁首或頁尾列印渲染後的網頁標題
  • {pdf-title}在頁首或頁尾列印文件標題

閱讀更多關於使用 IronPDF 處理頁首和頁尾的詳細資訊。 IronPDF 也支援HTML 頁眉和頁腳,以適應更複雜的設計。

以下範例展示如何實作上述用例並示範如何使用上述屬性:

using IronPdf;

static void Main(string[] args)
{
    // Create rendering converter
    var converter = new ChromePdfRenderer();
    // Setting Header properties
    converter.RenderingOptions.TextHeader = new TextHeaderFooter()
    {
        DrawDividerLine = true,
        LeftText = "Page Title",
        RightText = "{date} {time}",
        FontSize = 13
    };
    // Setting footer properties
    converter.RenderingOptions.TextFooter = new TextHeaderFooter()
    {
        RightText = "Page {page} of {total-pages}",
        FontSize = 12
    };
    // Specify the file to be converted
    using var PDF = converter.RenderHTMLFileAsPdf("myWebPage.html");
    // Save to target location
    PDF.SaveAs("sample.pdf");
}
using IronPdf;

static void Main(string[] args)
{
    // Create rendering converter
    var converter = new ChromePdfRenderer();
    // Setting Header properties
    converter.RenderingOptions.TextHeader = new TextHeaderFooter()
    {
        DrawDividerLine = true,
        LeftText = "Page Title",
        RightText = "{date} {time}",
        FontSize = 13
    };
    // Setting footer properties
    converter.RenderingOptions.TextFooter = new TextHeaderFooter()
    {
        RightText = "Page {page} of {total-pages}",
        FontSize = 12
    };
    // Specify the file to be converted
    using var PDF = converter.RenderHTMLFileAsPdf("myWebPage.html");
    // Save to target location
    PDF.SaveAs("sample.pdf");
}
Imports IronPdf

Shared Sub Main(ByVal args() As String)
	' Create rendering converter
	Dim converter = New ChromePdfRenderer()
	' Setting Header properties
	converter.RenderingOptions.TextHeader = New TextHeaderFooter() With {
		.DrawDividerLine = True,
		.LeftText = "Page Title",
		.RightText = "{date} {time}",
		.FontSize = 13
	}
	' Setting footer properties
	converter.RenderingOptions.TextFooter = New TextHeaderFooter() With {
		.RightText = "Page {page} of {total-pages}",
		.FontSize = 12
	}
	' Specify the file to be converted
	Dim PDF = converter.RenderHTMLFileAsPdf("myWebPage.html")
	' Save to target location
	PDF.SaveAs("sample.pdf")
End Sub
$vbLabelText   $csharpLabel

輸出:上述程式碼產生的新 PDF 檔案 sample.pdf 的螢幕截圖:

帶有自訂頁首的 PDF 文檔,顯示

使用 IronPDF 處理頁首和頁尾時,建立 PDF 檔案會使用到直覺易懂的語言。 現在,範例展示了 PrizmDoc Viewer 如何處理頁首和頁尾。

PrizmDoc Viewer 如何處理 PDF 頁首和頁尾?

PrizmDoc Viewer 提供 HeaderFooterOptions 類別來處理頁首和頁腳,具有以下屬性:

行數指定頁首和頁尾的行數,每行具有以下屬性: 左側 表示在頁首或頁尾行的左側列印文字 置中 將文字列印在頁首或頁尾行的中間。 表示在頁首或頁尾行的右側列印文字

  • FontFamily用於指定頁首或頁尾文字的字型系列
  • FontSize用於指定頁首或頁尾文字的字體大小 *顏色:用於指定頁首或頁尾文字的顏色

閱讀更多關於使用 PrizmDoc 伺服器設定 PDF 頁面頁首和頁尾的資訊。

以下範例展示如何使用上述屬性來實作該用例:

using System.Threading.Tasks;
using System.Collections.Generic;
using Accusoft.PrizmDocServer;
using Accusoft.PrizmDocServer.Conversion;

static void Main(string[] args)
{
    SetHeaderFooter().GetAwaiter().GetResult();
}

private static async Task SetHeaderFooter()
{
    // Instantiate PrizmDocServerClient object with Header and footer properties
    var prizmDocServer = new PrizmDocServerClient("___PROTECTED_URL_130___", "Your-API-KEY");

    ConversionResult result = await prizmDocServer.ConvertToPdfAsync(
        "myWebPage.html",
        header: new HeaderFooterOptions
        {
            Lines = new List<HeaderFooterLine>
            {
                new HeaderFooterLine { Left = "Page Title", Right = DateTime.Now.ToString() }
            },
        },
        footer: new HeaderFooterOptions
        {
            Lines = new List<HeaderFooterLine>
            {
                new HeaderFooterLine { Right = "Page {{pageNumber}} of {{pageCount}}" },
            },
        });

    // Save to the target location
    await result.RemoteWorkFile.SaveAsync("sample.pdf");
}
using System.Threading.Tasks;
using System.Collections.Generic;
using Accusoft.PrizmDocServer;
using Accusoft.PrizmDocServer.Conversion;

static void Main(string[] args)
{
    SetHeaderFooter().GetAwaiter().GetResult();
}

private static async Task SetHeaderFooter()
{
    // Instantiate PrizmDocServerClient object with Header and footer properties
    var prizmDocServer = new PrizmDocServerClient("___PROTECTED_URL_130___", "Your-API-KEY");

    ConversionResult result = await prizmDocServer.ConvertToPdfAsync(
        "myWebPage.html",
        header: new HeaderFooterOptions
        {
            Lines = new List<HeaderFooterLine>
            {
                new HeaderFooterLine { Left = "Page Title", Right = DateTime.Now.ToString() }
            },
        },
        footer: new HeaderFooterOptions
        {
            Lines = new List<HeaderFooterLine>
            {
                new HeaderFooterLine { Right = "Page {{pageNumber}} of {{pageCount}}" },
            },
        });

    // Save to the target location
    await result.RemoteWorkFile.SaveAsync("sample.pdf");
}
Imports System.Threading.Tasks
Imports System.Collections.Generic
Imports Accusoft.PrizmDocServer
Imports Accusoft.PrizmDocServer.Conversion

Module Program
    Sub Main(args As String())
        SetHeaderFooter().GetAwaiter().GetResult()
    End Sub

    Private Async Function SetHeaderFooter() As Task
        ' Instantiate PrizmDocServerClient object with Header and footer properties
        Dim prizmDocServer = New PrizmDocServerClient("___PROTECTED_URL_130___", "Your-API-KEY")

        Dim result As ConversionResult = Await prizmDocServer.ConvertToPdfAsync(
            "myWebPage.html",
            header:=New HeaderFooterOptions With {
                .Lines = New List(Of HeaderFooterLine) From {
                    New HeaderFooterLine With {.Left = "Page Title", .Right = DateTime.Now.ToString()}
                }
            },
            footer:=New HeaderFooterOptions With {
                .Lines = New List(Of HeaderFooterLine) From {
                    New HeaderFooterLine With {.Right = "Page {{pageNumber}} of {{pageCount}}"}
                }
            })

        ' Save to the target location
        Await result.RemoteWorkFile.SaveAsync("sample.pdf")
    End Function
End Module
$vbLabelText   $csharpLabel

輸出:

以下是上述程式碼產生的PDF檔案的螢幕截圖:

PDF with header showing 'Page Title' and timestamp, comparing `PrizmDoc`'s header/footer implementation

哪個函式庫在頁首和頁尾方面提供了更大的靈活性?

PrizmDoc Viewer 相比,IronPDF 提供了更多設定頁首和頁尾屬性的功能,並且程式設計結構更簡單。 IronPDF 產生的 PDF 檔案比 PrizmDoc Viewer 產生的檔案更易讀、更美觀。 IronPDF 也支援頁碼分頁符,以便更好地控製文件。


如何使用 IronPDF 而不是 PrizmDoc Viewer 將 PDF 頁面轉換為圖像?

為了進行比較,我們假設你有一個名為 Sample_PDF.pdf 的簡單 PDF 文件,其中包含兩頁。

頁一 第二頁
PDF 檢視器顯示範例 PDF 的第一頁,其中包含 Lorem ipsum 文字和標準檢視器控制項。
PDF 檢視器顯示範例 PDF 的第 2 頁,其中包含 Lorem ipsum 文字和導覽控制項。

任務是為每一頁創建圖像。 首先,範例將展示如何使用 IronPDF 執行此操作。

IronPDF 如何將 PDF 頁面轉換為影像?

using IronPdf;

static void Main(string[] args)
{
    // Specify file to be converted
    var pdf = PdfDocument.FromFile("Sample_PDF.pdf");
    // Save images to the target location
    pdf.RasterizeToImageFiles("image_*.png");
}
using IronPdf;

static void Main(string[] args)
{
    // Specify file to be converted
    var pdf = PdfDocument.FromFile("Sample_PDF.pdf");
    // Save images to the target location
    pdf.RasterizeToImageFiles("image_*.png");
}
Imports IronPdf

Shared Sub Main(ByVal args() As String)
	' Specify file to be converted
	Dim pdf = PdfDocument.FromFile("Sample_PDF.pdf")
	' Save images to the target location
	pdf.RasterizeToImageFiles("image_*.png")
End Sub
$vbLabelText   $csharpLabel

IronPDF 也支援將影像儲存到記憶體流,並支援多種影像格式,包括 JPEG、TIFF 等。

輸出:

以上程式碼建立了以下兩個 .png 圖片:

頁一 圖片 第二頁 圖片
從 PDF 第 1 頁產生的 PNG 影像,顯示了虛擬力學教學內容,文字清晰可見。
從 PDF 第 2 頁產生的 PNG 影像,顯示了具有 IronPDF 柵格化品質的連續文字內容。

使用 IronPDF 建立 PDF 頁面影像非常簡單。 現在,讓我們使用 PrizmDoc Viewer 執行相同的任務。

PrizmDoc Viewer 如何將 PDF 頁面轉換為圖片?

using System.Linq;
using System.Collections.Generic;
using System.Threading.Tasks;
using Accusoft.PrizmDocServer;
using Accusoft.PrizmDocServer.Conversion;

static void Main(string[] args)
{
    PdfToImage().GetAwaiter().GetResult();
}

private static async Task PdfToImage()
{
    // Instantiate PrizmDocServerClient object
    var prizmDocServer = new PrizmDocServerClient("___PROTECTED_URL_131___", "Your-API-KEY");
    // Convert PDF file to images
    IEnumerable<ConversionResult> results = await prizmDocServer.ConvertAsync("Sample_PDF.pdf", DestinationFileFormat.Png);

    // Save each image.
    for (int i = 0; i < results.Count(); i++)
    {
        await results.ElementAt(i).RemoteWorkFile.SaveAsync($"page-{i + 1}.png");
    }
}
using System.Linq;
using System.Collections.Generic;
using System.Threading.Tasks;
using Accusoft.PrizmDocServer;
using Accusoft.PrizmDocServer.Conversion;

static void Main(string[] args)
{
    PdfToImage().GetAwaiter().GetResult();
}

private static async Task PdfToImage()
{
    // Instantiate PrizmDocServerClient object
    var prizmDocServer = new PrizmDocServerClient("___PROTECTED_URL_131___", "Your-API-KEY");
    // Convert PDF file to images
    IEnumerable<ConversionResult> results = await prizmDocServer.ConvertAsync("Sample_PDF.pdf", DestinationFileFormat.Png);

    // Save each image.
    for (int i = 0; i < results.Count(); i++)
    {
        await results.ElementAt(i).RemoteWorkFile.SaveAsync($"page-{i + 1}.png");
    }
}
Imports System.Linq
Imports System.Collections.Generic
Imports System.Threading.Tasks
Imports Accusoft.PrizmDocServer
Imports Accusoft.PrizmDocServer.Conversion

Module Program
    Sub Main(args As String())
        PdfToImage().GetAwaiter().GetResult()
    End Sub

    Private Async Function PdfToImage() As Task
        ' Instantiate PrizmDocServerClient object
        Dim prizmDocServer = New PrizmDocServerClient("___PROTECTED_URL_131___", "Your-API-KEY")
        ' Convert PDF file to images
        Dim results As IEnumerable(Of ConversionResult) = Await prizmDocServer.ConvertAsync("Sample_PDF.pdf", DestinationFileFormat.Png)

        ' Save each image.
        For i As Integer = 0 To results.Count() - 1
            Await results.ElementAt(i).RemoteWorkFile.SaveAsync($"page-{i + 1}.png")
        Next
    End Function
End Module
$vbLabelText   $csharpLabel

輸出:

上述程式碼也會建立以下兩個 .png 映像:

頁一 第二頁
PNG image generated from PDF page 1 using `PrizmDoc`'s conversion service with sample text content
PNG image generated from PDF page 2 showing `PrizmDoc`'s image conversion output quality

哪個函式庫能讓PDF轉影像轉換更輕鬆?

PrizmDoc Viewer 相比,IronPDF 允許開發人員使用最少的程式碼行輕鬆建立每一頁的圖像,即使不遍歷頁面。


我可以在 IronPDF 中使用 Bootstrap 5 數據表嗎?

IronPDF 的Chrome V8 渲染引擎Bootstrap 5 資料表提供了出色的支持,使開發人員能夠產生具有複雜表格佈局的專業PDF 報告。 此範例示範了漸層標題、狀態徽章、分頁控制和摘要指標-這些功能突顯了 IronPDF 相對於傳統 PDF 檢視器(如 PrizmDoc)的優勢。 IronPDF 完全支援現代 CSS 功能,包括flexbox 版面漸層響應式設計

using IronPdf;

var renderer = new ChromePdfRenderer();

string dataTableReport = @"
<!DOCTYPE html>
<html>
<head>
    <meta charset='utf-8'>
    <link href='___PROTECTED_URL_132___ rel='stylesheet'>
    <style>
        .table-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 30px;
            border-radius: 10px 10px 0 0;
        }
        .table-container {
            background: white;
            border-radius: 0 0 10px 10px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            overflow: hidden;
        }
        .table th {
            background: #f8f9fa;
            font-weight: 600;
            text-transform: uppercase;
            font-size: 0.85rem;
            letter-spacing: 0.5px;
        }
        .status-badge {
            padding: 0.35em 0.65em;
            border-radius: 0.25rem;
            font-weight: 600;
            font-size: 0.75rem;
        }
        .trend-positive { color: #198754; font-weight: 700; }
        .trend-negative { color: #dc3545; font-weight: 700; }
        @media print {
            .table-container { page-break-inside: avoid; }
        }
    </style>
</head>
<body class='bg-light'>
    <div class='container py-5'>
        <div class='table-container'>
            <div class='table-header'>
                <div class='row align-items-center'>
                    <div class='col-md-8'>
                        <h2 class='mb-2'>Sales Performance Report</h2>
                        <p class='mb-0 opacity-75'>Q4 2024 Regional Analysis</p>
                    </div>
                    <div class='col-md-4 text-end'>
                        <div class='btn-group btn-group-sm'>
                            <button class='btn btn-light'>Export</button>
                            <button class='btn btn-light'>Filter</button>
                            <button class='btn btn-light'>Sort</button>
                        </div>
                    </div>
                </div>
            </div>

            <div class='p-4'>
                <div class='row mb-3'>
                    <div class='col-md-4'>
                        <input type='text' class='form-control form-control-sm' placeholder='Search regions...'>
                    </div>
                    <div class='col-md-8 text-end'>
                        <span class='text-muted small'>Showing 1-10 of 48 results</span>
                    </div>
                </div>

                <div class='table-responsive'>
                    <table class='table table-hover align-middle'>
                        <thead>
                            <tr>
                                <th>Region</th>
                                <th>Revenue</th>
                                <th>Units Sold</th>
                                <th>Growth</th>
                                <th>Status</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>
                                    <strong>North America</strong><br>
                                    <small class='text-muted'>USA, Canada, Mexico</small>
                                </td>
                                <td>$4,280,000</td>
                                <td>12,450</td>
                                <td><span class='trend-positive'>↑ 18.5%</span></td>
                                <td><span class='status-badge bg-success text-white'>Exceeding</span></td>
                                <td><button class='btn btn-sm btn-outline-primary'>Details</button></td>
                            </tr>
                            <tr>
                                <td>
                                    <strong>Europe</strong><br>
                                    <small class='text-muted'>EU, UK, Switzerland</small>
                                </td>
                                <td>$3,650,000</td>
                                <td>10,890</td>
                                <td><span class='trend-positive'>↑ 12.3%</span></td>
                                <td><span class='status-badge bg-success text-white'>On Track</span></td>
                                <td><button class='btn btn-sm btn-outline-primary'>Details</button></td>
                            </tr>
                            <tr>
                                <td>
                                    <strong>Asia Pacific</strong><br>
                                    <small class='text-muted'>Japan, Australia, Singapore</small>
                                </td>
                                <td>$2,940,000</td>
                                <td>8,320</td>
                                <td><span class='trend-positive'>↑ 24.7%</span></td>
                                <td><span class='status-badge bg-primary text-white'>Growing</span></td>
                                <td><button class='btn btn-sm btn-outline-primary'>Details</button></td>
                            </tr>
                            <tr>
                                <td>
                                    <strong>Latin America</strong><br>
                                    <small class='text-muted'>Brazil, Argentina, Chile</small>
                                </td>
                                <td>$1,580,000</td>
                                <td>4,670</td>
                                <td><span class='trend-positive'>↑ 8.9%</span></td>
                                <td><span class='status-badge bg-info text-white'>Stable</span></td>
                                <td><button class='btn btn-sm btn-outline-primary'>Details</button></td>
                            </tr>
                            <tr>
                                <td>
                                    <strong>Middle East</strong><br>
                                    <small class='text-muted'>UAE, Saudi Arabia, Israel</small>
                                </td>
                                <td>$980,000</td>
                                <td>2,890</td>
                                <td><span class='trend-negative'>↓ 3.2%</span></td>
                                <td><span class='status-badge bg-warning text-dark'>Review</span></td>
                                <td><button class='btn btn-sm btn-outline-primary'>Details</button></td>
                            </tr>
                        </tbody>
                        <tfoot class='table-light'>
                            <tr>
                                <td><strong>Total</strong></td>
                                <td><strong>$13,430,000</strong></td>
                                <td><strong>39,220</strong></td>
                                <td><strong class='trend-positive'>↑ 14.8%</strong></td>
                                <td colspan='2'></td>
                            </tr>
                        </tfoot>
                    </table>
                </div>

                <div class='d-flex justify-content-between align-items-center mt-4'>
                    <div>
                        <select class='form-select form-select-sm' style='width: auto; display: inline-block;'>
                            <option>10 per page</option>
                            <option>25 per page</option>
                            <option>50 per page</option>
                        </select>
                    </div>
                    <nav>
                        <ul class='pagination pagination-sm mb-0'>
                            <li class='page-item disabled'><a class='page-link' href='#'>Previous</a></li>
                            <li class='page-item active'><a class='page-link' href='#'>1</a></li>
                            <li class='page-item'><a class='page-link' href='#'>2</a></li>
                            <li class='page-item'><a class='page-link' href='#'>3</a></li>
                            <li class='page-item'><a class='page-link' href='#'>Next</a></li>
                        </ul>
                    </nav>
                </div>
            </div>
        </div>

        <div class='row g-3 mt-4'>
            <div class='col-md-3'>
                <div class='card text-center'>
                    <div class='card-body'>
                        <h3 class='text-primary mb-1'>$13.4M</h3>
                        <small class='text-muted'>Total Revenue</small>
                    </div>
                </div>
            </div>
            <div class='col-md-3'>
                <div class='card text-center'>
                    <div class='card-body'>
                        <h3 class='text-success mb-1'>39,220</h3>
                        <small class='text-muted'>Units Sold</small>
                    </div>
                </div>
            </div>
            <div class='col-md-3'>
                <div class='card text-center'>
                    <div class='card-body'>
                        <h3 class='text-info mb-1'>14.8%</h3>
                        <small class='text-muted'>Growth Rate</small>
                    </div>
                </div>
            </div>
            <div class='col-md-3'>
                <div class='card text-center'>
                    <div class='card-body'>
                        <h3 class='text-warning mb-1'>5</h3>
                        <small class='text-muted'>Active Regions</small>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>";

var pdf = renderer.RenderHtmlAsPdf(dataTableReport);
pdf.SaveAs("data-table-report.pdf");
using IronPdf;

var renderer = new ChromePdfRenderer();

string dataTableReport = @"
<!DOCTYPE html>
<html>
<head>
    <meta charset='utf-8'>
    <link href='___PROTECTED_URL_132___ rel='stylesheet'>
    <style>
        .table-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 30px;
            border-radius: 10px 10px 0 0;
        }
        .table-container {
            background: white;
            border-radius: 0 0 10px 10px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            overflow: hidden;
        }
        .table th {
            background: #f8f9fa;
            font-weight: 600;
            text-transform: uppercase;
            font-size: 0.85rem;
            letter-spacing: 0.5px;
        }
        .status-badge {
            padding: 0.35em 0.65em;
            border-radius: 0.25rem;
            font-weight: 600;
            font-size: 0.75rem;
        }
        .trend-positive { color: #198754; font-weight: 700; }
        .trend-negative { color: #dc3545; font-weight: 700; }
        @media print {
            .table-container { page-break-inside: avoid; }
        }
    </style>
</head>
<body class='bg-light'>
    <div class='container py-5'>
        <div class='table-container'>
            <div class='table-header'>
                <div class='row align-items-center'>
                    <div class='col-md-8'>
                        <h2 class='mb-2'>Sales Performance Report</h2>
                        <p class='mb-0 opacity-75'>Q4 2024 Regional Analysis</p>
                    </div>
                    <div class='col-md-4 text-end'>
                        <div class='btn-group btn-group-sm'>
                            <button class='btn btn-light'>Export</button>
                            <button class='btn btn-light'>Filter</button>
                            <button class='btn btn-light'>Sort</button>
                        </div>
                    </div>
                </div>
            </div>

            <div class='p-4'>
                <div class='row mb-3'>
                    <div class='col-md-4'>
                        <input type='text' class='form-control form-control-sm' placeholder='Search regions...'>
                    </div>
                    <div class='col-md-8 text-end'>
                        <span class='text-muted small'>Showing 1-10 of 48 results</span>
                    </div>
                </div>

                <div class='table-responsive'>
                    <table class='table table-hover align-middle'>
                        <thead>
                            <tr>
                                <th>Region</th>
                                <th>Revenue</th>
                                <th>Units Sold</th>
                                <th>Growth</th>
                                <th>Status</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>
                                    <strong>North America</strong><br>
                                    <small class='text-muted'>USA, Canada, Mexico</small>
                                </td>
                                <td>$4,280,000</td>
                                <td>12,450</td>
                                <td><span class='trend-positive'>↑ 18.5%</span></td>
                                <td><span class='status-badge bg-success text-white'>Exceeding</span></td>
                                <td><button class='btn btn-sm btn-outline-primary'>Details</button></td>
                            </tr>
                            <tr>
                                <td>
                                    <strong>Europe</strong><br>
                                    <small class='text-muted'>EU, UK, Switzerland</small>
                                </td>
                                <td>$3,650,000</td>
                                <td>10,890</td>
                                <td><span class='trend-positive'>↑ 12.3%</span></td>
                                <td><span class='status-badge bg-success text-white'>On Track</span></td>
                                <td><button class='btn btn-sm btn-outline-primary'>Details</button></td>
                            </tr>
                            <tr>
                                <td>
                                    <strong>Asia Pacific</strong><br>
                                    <small class='text-muted'>Japan, Australia, Singapore</small>
                                </td>
                                <td>$2,940,000</td>
                                <td>8,320</td>
                                <td><span class='trend-positive'>↑ 24.7%</span></td>
                                <td><span class='status-badge bg-primary text-white'>Growing</span></td>
                                <td><button class='btn btn-sm btn-outline-primary'>Details</button></td>
                            </tr>
                            <tr>
                                <td>
                                    <strong>Latin America</strong><br>
                                    <small class='text-muted'>Brazil, Argentina, Chile</small>
                                </td>
                                <td>$1,580,000</td>
                                <td>4,670</td>
                                <td><span class='trend-positive'>↑ 8.9%</span></td>
                                <td><span class='status-badge bg-info text-white'>Stable</span></td>
                                <td><button class='btn btn-sm btn-outline-primary'>Details</button></td>
                            </tr>
                            <tr>
                                <td>
                                    <strong>Middle East</strong><br>
                                    <small class='text-muted'>UAE, Saudi Arabia, Israel</small>
                                </td>
                                <td>$980,000</td>
                                <td>2,890</td>
                                <td><span class='trend-negative'>↓ 3.2%</span></td>
                                <td><span class='status-badge bg-warning text-dark'>Review</span></td>
                                <td><button class='btn btn-sm btn-outline-primary'>Details</button></td>
                            </tr>
                        </tbody>
                        <tfoot class='table-light'>
                            <tr>
                                <td><strong>Total</strong></td>
                                <td><strong>$13,430,000</strong></td>
                                <td><strong>39,220</strong></td>
                                <td><strong class='trend-positive'>↑ 14.8%</strong></td>
                                <td colspan='2'></td>
                            </tr>
                        </tfoot>
                    </table>
                </div>

                <div class='d-flex justify-content-between align-items-center mt-4'>
                    <div>
                        <select class='form-select form-select-sm' style='width: auto; display: inline-block;'>
                            <option>10 per page</option>
                            <option>25 per page</option>
                            <option>50 per page</option>
                        </select>
                    </div>
                    <nav>
                        <ul class='pagination pagination-sm mb-0'>
                            <li class='page-item disabled'><a class='page-link' href='#'>Previous</a></li>
                            <li class='page-item active'><a class='page-link' href='#'>1</a></li>
                            <li class='page-item'><a class='page-link' href='#'>2</a></li>
                            <li class='page-item'><a class='page-link' href='#'>3</a></li>
                            <li class='page-item'><a class='page-link' href='#'>Next</a></li>
                        </ul>
                    </nav>
                </div>
            </div>
        </div>

        <div class='row g-3 mt-4'>
            <div class='col-md-3'>
                <div class='card text-center'>
                    <div class='card-body'>
                        <h3 class='text-primary mb-1'>$13.4M</h3>
                        <small class='text-muted'>Total Revenue</small>
                    </div>
                </div>
            </div>
            <div class='col-md-3'>
                <div class='card text-center'>
                    <div class='card-body'>
                        <h3 class='text-success mb-1'>39,220</h3>
                        <small class='text-muted'>Units Sold</small>
                    </div>
                </div>
            </div>
            <div class='col-md-3'>
                <div class='card text-center'>
                    <div class='card-body'>
                        <h3 class='text-info mb-1'>14.8%</h3>
                        <small class='text-muted'>Growth Rate</small>
                    </div>
                </div>
            </div>
            <div class='col-md-3'>
                <div class='card text-center'>
                    <div class='card-body'>
                        <h3 class='text-warning mb-1'>5</h3>
                        <small class='text-muted'>Active Regions</small>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>";

var pdf = renderer.RenderHtmlAsPdf(dataTableReport);
pdf.SaveAs("data-table-report.pdf");
Imports IronPdf

Dim renderer = New ChromePdfRenderer()

Dim dataTableReport As String = "
<!DOCTYPE html>
<html>
<head>
    <meta charset='utf-8'>
    <link href='___PROTECTED_URL_132___ rel='stylesheet'>
    <style>
        .table-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 30px;
            border-radius: 10px 10px 0 0;
        }
        .table-container {
            background: white;
            border-radius: 0 0 10px 10px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            overflow: hidden;
        }
        .table th {
            background: #f8f9fa;
            font-weight: 600;
            text-transform: uppercase;
            font-size: 0.85rem;
            letter-spacing: 0.5px;
        }
        .status-badge {
            padding: 0.35em 0.65em;
            border-radius: 0.25rem;
            font-weight: 600;
            font-size: 0.75rem;
        }
        .trend-positive { color: #198754; font-weight: 700; }
        .trend-negative { color: #dc3545; font-weight: 700; }
        @media print {
            .table-container { page-break-inside: avoid; }
        }
    </style>
</head>
<body class='bg-light'>
    <div class='container py-5'>
        <div class='table-container'>
            <div class='table-header'>
                <div class='row align-items-center'>
                    <div class='col-md-8'>
                        <h2 class='mb-2'>Sales Performance Report</h2>
                        <p class='mb-0 opacity-75'>Q4 2024 Regional Analysis</p>
                    </div>
                    <div class='col-md-4 text-end'>
                        <div class='btn-group btn-group-sm'>
                            <button class='btn btn-light'>Export</button>
                            <button class='btn btn-light'>Filter</button>
                            <button class='btn btn-light'>Sort</button>
                        </div>
                    </div>
                </div>
            </div>

            <div class='p-4'>
                <div class='row mb-3'>
                    <div class='col-md-4'>
                        <input type='text' class='form-control form-control-sm' placeholder='Search regions...'>
                    </div>
                    <div class='col-md-8 text-end'>
                        <span class='text-muted small'>Showing 1-10 of 48 results</span>
                    </div>
                </div>

                <div class='table-responsive'>
                    <table class='table table-hover align-middle'>
                        <thead>
                            <tr>
                                <th>Region</th>
                                <th>Revenue</th>
                                <th>Units Sold</th>
                                <th>Growth</th>
                                <th>Status</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>
                                    <strong>North America</strong><br>
                                    <small class='text-muted'>USA, Canada, Mexico</small>
                                </td>
                                <td>$4,280,000</td>
                                <td>12,450</td>
                                <td><span class='trend-positive'>↑ 18.5%</span></td>
                                <td><span class='status-badge bg-success text-white'>Exceeding</span></td>
                                <td><button class='btn btn-sm btn-outline-primary'>Details</button></td>
                            </tr>
                            <tr>
                                <td>
                                    <strong>Europe</strong><br>
                                    <small class='text-muted'>EU, UK, Switzerland</small>
                                </td>
                                <td>$3,650,000</td>
                                <td>10,890</td>
                                <td><span class='trend-positive'>↑ 12.3%</span></td>
                                <td><span class='status-badge bg-success text-white'>On Track</span></td>
                                <td><button class='btn btn-sm btn-outline-primary'>Details</button></td>
                            </tr>
                            <tr>
                                <td>
                                    <strong>Asia Pacific</strong><br>
                                    <small class='text-muted'>Japan, Australia, Singapore</small>
                                </td>
                                <td>$2,940,000</td>
                                <td>8,320</td>
                                <td><span class='trend-positive'>↑ 24.7%</span></td>
                                <td><span class='status-badge bg-primary text-white'>Growing</span></td>
                                <td><button class='btn btn-sm btn-outline-primary'>Details</button></td>
                            </tr>
                            <tr>
                                <td>
                                    <strong>Latin America</strong><br>
                                    <small class='text-muted'>Brazil, Argentina, Chile</small>
                                </td>
                                <td>$1,580,000</td>
                                <td>4,670</td>
                                <td><span class='trend-positive'>↑ 8.9%</span></td>
                                <td><span class='status-badge bg-info text-white'>Stable</span></td>
                                <td><button class='btn btn-sm btn-outline-primary'>Details</button></td>
                            </tr>
                            <tr>
                                <td>
                                    <strong>Middle East</strong><br>
                                    <small class='text-muted'>UAE, Saudi Arabia, Israel</small>
                                </td>
                                <td>$980,000</td>
                                <td>2,890</td>
                                <td><span class='trend-negative'>↓ 3.2%</span></td>
                                <td><span class='status-badge bg-warning text-dark'>Review</span></td>
                                <td><button class='btn btn-sm btn-outline-primary'>Details</button></td>
                            </tr>
                        </tbody>
                        <tfoot class='table-light'>
                            <tr>
                                <td><strong>Total</strong></td>
                                <td><strong>$13,430,000</strong></td>
                                <td><strong>39,220</strong></td>
                                <td><strong class='trend-positive'>↑ 14.8%</strong></td>
                                <td colspan='2'></td>
                            </tr>
                        </tfoot>
                    </table>
                </div>

                <div class='d-flex justify-content-between align-items-center mt-4'>
                    <div>
                        <select class='form-select form-select-sm' style='width: auto; display: inline-block;'>
                            <option>10 per page</option>
                            <option>25 per page</option>
                            <option>50 per page</option>
                        </select>
                    </div>
                    <nav>
                        <ul class='pagination pagination-sm mb-0'>
                            <li class='page-item disabled'><a class='page-link' href='#'>Previous</a></li>
                            <li class='page-item active'><a class='page-link' href='#'>1</a></li>
                            <li class='page-item'><a class='page-link' href='#'>2</a></li>
                            <li class='page-item'><a class='page-link' href='#'>3</a></li>
                            <li class='page-item'><a class='page-link' href='#'>Next</a></li>
                        </ul>
                    </nav>
                </div>
            </div>
        </div>

        <div class='row g-3 mt-4'>
            <div class='col-md-3'>
                <div class='card text-center'>
                    <div class='card-body'>
                        <h3 class='text-primary mb-1'>$13.4M</h3>
                        <small class='text-muted'>Total Revenue</small>
                    </div>
                </div>
            </div>
            <div class='col-md-3'>
                <div class='card text-center'>
                    <div class='card-body'>
                        <h3 class='text-success mb-1'>39,220</h3>
                        <small class='text-muted'>Units Sold</small>
                    </div>
                </div>
            </div>
            <div class='col-md-3'>
                <div class='card text-center'>
                    <div class='card-body'>
                        <h3 class='text-info mb-1'>14.8%</h3>
                        <small class='text-muted'>Growth Rate</small>
                    </div>
                </div>
            </div>
            <div class='col-md-3'>
                <div class='card text-center'>
                    <div class='card-body'>
                        <h3 class='text-warning mb-1'>5</h3>
                        <small class='text-muted'>Active Regions</small>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>"

Dim pdf = renderer.RenderHtmlAsPdf(dataTableReport)
pdf.SaveAs("data-table-report.pdf")
$vbLabelText   $csharpLabel

此代碼會產生一份複雜的資料表報告,其中包含漸層式標題、反應式表格、狀態徽章和摘要指標。 IronPDF 的 Chrome 渲染引擎保留了所有 Bootstrap 樣式,包括表格懸停效果、徽章顏色和分頁控制——這些功能超越了傳統的 PDF 檢視器。 該引擎還支援動態內容的JavaScript 渲染自訂字體UTF-8 國際字元

PrizmDoc Viewer 相比的主要優勢:

有關 Bootstrap PDF 生成的更多詳細信息,請參閱完整的渲染文件。 開發者還可以探索Angular 到 PDF 的轉換以及其他JavaScript 框架支援。 ## IronPDF 和 PrizmDoc Viewer 的授權成本有何不同?

在審查了兩個組件的技術結構和可用功能後,以下概述了授權定價。 這一點至關重要,因為開發人員的目標是在預算限制內滿足需求。

IronPDF有哪些許可選項?

IronPDF 許可證起價為$699適用於單一專案和一名開發人員。 IronPDF 提供靈活的許可選項,包括開發許可、部署許可擴展選項,以提供持續的支援和更新。

對於服務多個客戶的公司或機構的開發人員來說,許可證起價為 699 美元,並可根據團隊規模和專案數量進行調整。 IronPDF提供隨著需求變化而調整的許可證升級方案

以下許可證需要一次付費:

開發人員數量 價格
1-5 $699
6-10 $799
11-20 $899
21-50 $1,499
Unlimited $1,199
  • 對於擁有多個辦公地點的公司,許可證起價為1199 美元。
  • SaaS 服務的授權費用起價為1099 美元。
  • 免版稅的OEM再發行授權起價為1599美元。

注意:以上所有許可套餐均包含1 年的支援和更新

閱讀更多關於IronPDF所有可用許可套餐的資訊。 開發人員還可以透過多種方式應用許可證金鑰,包括Web.config和環境變數。

PrizmDoc Viewer 的授權選項有哪些?

What Is the Cost of Self-Hosted `PrizmDoc`?

對於自行管理的伺服器,標準支援服務的授權價格為每年7,900 美元

閱讀更多關於 PrizmDoc Viewer 的所有可用軟體包的資訊。

How Much Does Cloud-Based `PrizmDoc` Cost?

此授權涵蓋 PrizmDoc Viewer 的雲端服務,並根據交易數量進行擴展。

詞彙:

Transaction指的是向 PrizmDoc 檢視器伺服器發送請求並接收輸出(結果文件)。

預付桶表示一次性付款,即可獲得永不過期的優惠。

交易次數 預付桶 Monthly 每年
200 $18
1,000 $89
2,000 $119
6,000 $254 $169 1,859美元(6,000筆交易/月)
12,000 $434 $289 $3,179 (12,000 交易/月)
25,000 $699 $499 5,459 美元 (25,000 次交易/月)
50,000 $1,199 $799 8,789美元(50,000筆交易/月)
100,000 $1,499 $1,499 10,989美元(100,000筆交易/月)
20萬 $2,549 $1,699 19,188美元(20萬筆交易/月)
30萬 $3,299 $2,199 25,188 美元(每月 30萬 筆交易)
40萬 $4,049 $2,699 31,188美元(40萬筆交易/月)
500,000 $4,799 $3,199 37,188美元(500,000筆交易/月)

教程快速存取

Html To Pdf Icon related to 教程快速存取

獲取 C# IronPDF 快速入門手冊

這是一個免費的 PDF 資源指南,它簡化了 .NET 中 PDF 的開發,提供了常用函數的演練以及在 C# 和 VB.NET 中操作、編輯、生成和保存 PDF 的範例,適用於各種專案。

下載指南

探索 IronPDF API 參考資料

探索 IronPDF C# 庫的 API 參考,包括 IronPDF 的所有功能、類別、方法欄位、命名空間和枚舉的詳細資訊。

檢視 API 參考資料
Documentation related to 教程快速存取

請注意Accusoft 的 PrizmDoc Viewer 是其各自所有者的註冊商標。 本網站與 Accusoft 的 PrizmDoc Viewer 沒有任何關聯、認可或贊助關係。 所有產品名稱、標誌和品牌均為其各自擁有者的財產。 比較僅供參考,反映了撰寫時的公開信息。

常見問題

怎樣在 C# 中將 HTML 轉換為 PDF?

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

使用 IronPDF 而不是 PrizmDoc Viewer 進行 PDF 轉換的優點是什麼?

IronPDF 提供了一個簡便的本地 PDF 渲染解決方案,支持離線工作,無需異步程序設計。相比之下,PrizmDoc 查看器通過 REST API 運行,需要網路連接以便與遠程服務器進行交互。

我可以使用 PDF 庫合併多個 PDF 文檔嗎?

可以,使用 IronPDF,您可以使用 MergePdf 方法合併多個 PDF,讓您可以無縫地組合文檔。

IronPDF 如何處理 PDF 到圖像的轉換?

IronPDF 允許您輕鬆使用其內置方法將 PDF 頁面轉換為圖像,提供了一種簡化的方法,與其他軟件相比。

IronPDF 中的頁眉和頁腳自定義選項有哪些?

IronPDF 提供了豐富的功能來設置頁眉和頁腳屬性,具有簡單的編程結構,使您可以輕鬆自定義文檔。

IronPDF 適合離線 PDF 處理嗎?

是的,IronPDF 支持離線 PDF 處理,這意味著您可以在沒有網路連接的情況下工作,不像某些其他解決方案需要遠程服務器交互。

IronPDF 許可的成本結構是什麼樣的?

IronPDF 許可費用從單個開發團隊的單個項目 $699 起,並為公司和 SaaS 服務提供可擴展的選擇,提供經濟實惠的一次性付款解決方案。

我可以免費使用 IronPDF 進行開發嗎?

是的,IronPDF 為開發提供免費使用,不限時間,並提供 30 天部署試用,以便您的項目實施。

PrizmDoc Viewer 如何處理 HTML 到 PDF 的轉換?

PrizmDoc Viewer 使用 REST API 進行 HTML 到 PDF 的轉換,需要異步程序設計和網路連接來與遠程服務器交互。

自託管 PrizmDoc Server 的系統要求是什麼?

自託管 PrizmDoc 服務器需要至少 32 GB RAM 和 4 核心 CPU,以滿足其處理需求。

IronPDF 是否與 .NET 10 完全相容?

是的。IronPDF 支援 .NET 10(以及 .NET 9、8、7、6、.NET Core、.NET Standard 和 .NET Framework)。它通過 NuGet 安裝,可以在 Windows、Linux 和 macOS 上運行,並使用其本機的 Chrome 渲染器在 .NET 10 應用程序中提供像素級精確的 HTML 到 PDF 渲染。

Curtis Chau
技術撰稿人

Curtis Chau 擁有卡爾頓大學(Carleton University)的電腦科學學士學位,專精於前端開發,並精通 Node.js、TypeScript、JavaScript 及 React。他熱衷於打造直觀且美觀的用戶介面,喜歡運用現代框架,並創建結構完善、視覺上吸引人的手冊。

除了開發工作之外,Curtis 對物聯網(IoT)抱有濃厚興趣,致力於探索整合硬體與軟體的創新方法。閒暇時,他喜歡玩遊戲和開發 Discord 機器人,將對科技的熱愛與創意相結合。

鋼鐵支援團隊

我們每週 5 天,每天 24 小時在線上。
聊天
電子郵件
打電話給我