跳過到頁腳內容
產品比較

IronPDF vs Accusoft PDF Viewer: Which C# Library Is Best for HTML to 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 字串網頁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/). 通常需要很多行程式碼。
[無限 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 提供的函數和類,包括用於渲染、 PDF 文件操作安全功能的ChromePdfRenderer

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

  • 軟體套件管理器控制台:

    如果使用程式包管理器控制台,請執行下列命令:

    _CODEBLOCK1

  • 管理解決方案的軟體包:

    如果使用NuGet 套件管理器GUI,請在搜尋列中搜尋 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 Server 是一個伺服器端應用程序,它接收包含文件的基本資訊作為請求(輸入),並將文件轉換為PDF 文件,然後將轉換後的 PDF 文件作為回應(輸出)發送回去。 它是產品的技術核心—一個文件處理和轉換引擎。開發人員可以透過兩種不同的方法使用它,這兩種方法都具有相同的程式結構和技術:

1.自架:

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

注意:為了獲得更好的效能,需要至少 32 GB 記憶體和 4 核心 CPU。 相比之下, 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. 將檔案上傳到伺服器:

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 Server REST API 的封裝器。 讓我們來探討如何在 .NET 專案中安裝和使用此程式庫。

How Do I Install Accusoft.PrizmDocServerSDK?

安裝包裝器有兩種方法。

  • 軟體套件管理器控制台:

    如果使用程式包管理器控制台,請執行下列命令:

    _CODEBLOCK10

  • 管理解決方案的軟體包:

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

現在,開發人員可以輕鬆存取Accusoft.PrizmDocServer命名空間並使用它:

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

操作教學課程

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

在回顧了兩個組件的介紹和安裝之後,現在是時候使用這兩個組件了。 以下用例示範如何使用這兩個元件進行實現,以幫助理解程式設計結構並確定哪個元件最符合專案要求。


如何使用 IronPDF 和PrizmDoc Viewer 將 HTML 轉換為 PDF?

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

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&gt;debug資料夾中。 IronPDF 也支援HTML 字串URL ,甚至包含 HTML 的 ZIP 檔案作為輸入來源。

開發人員也可以指定任意路徑,例如: PDF.SaveAs(&quot;E:/sample.pdf&quot;);或儲存到記憶體流以進行雲端部署。

閱讀更多關於使用 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 儲存體中的影像以及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 新增頁首和頁尾?

為了進行比較,假設存在一個名為myWebPage.html的簡單WebPage ,其 HTML 和 CSS 程式碼如下:

<html>
<head>
    <style>
        li {
            font-size: x-large;
            color: rgba(156, 89, 13, 0.897);
            list-style: square;
        }
    </style>
</head>
<body>
    <h1>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>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屬性,其用法如下:

*用於頁首:

___CODEBLOCK_19___

*用於頁尾:

___CODEBLOCK_20___

初始化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 文件,其中包含兩頁。

第1頁 第2頁
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影像:

第1頁 圖片 第2頁 圖片
從 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影像:

第1頁 第2頁
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 相對於PrizmDoc等傳統 PDF 檢視器的優勢。 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>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>$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>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>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>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>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>$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>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>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>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 As 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>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>$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>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>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>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,199
無限 $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 Viewer 伺服器發送請求並接收輸出(結果文件)。

預付費桶是指一次性付費,即可獲得永不過期的交易記錄。

交易次數 預付費桶 每月 每年
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,199 $1,199 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。

與 PrizmDoc Viewer 相比,使用 IronPDF 進行 PDF 轉換有哪些優勢?

IronPDF 提供直接的本機 PDF 渲染解決方案,支援離線工作而不需要異步程式設計。相比之下,PrizmDoc Viewer 透過 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 伺服器的系統需求為何?

自託管的 PrizmDoc 伺服器至少需要 32 GB 記憶體和 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-to-PDF 渲染。

Curtis Chau
技術撰稿人

Curtis Chau 擁有電腦科學學士學位(卡爾頓大學),專長於前端開發,精通 Node.js、TypeScript、JavaScript 和 React。Curtis 對製作直覺且美觀的使用者介面充滿熱情,他喜歡使用現代化的架構,並製作結構良好且視覺上吸引人的手冊。

除了開發之外,Curtis 對物聯網 (IoT) 也有濃厚的興趣,他喜歡探索整合硬體與軟體的創新方式。在空閒時間,他喜歡玩遊戲和建立 Discord bots,將他對技術的熱愛與創意結合。