製品比較

Accusoft Prizmdoc PDF Viewer チュートリアルおよび比較

チペゴ
チペゴ・カリンダ
2021年9月2日
共有:

Accusoft PDFビューアは、HTMLからPDFへの変換機能やその他のPDF編集および操作タスクを.NET向けに提供します。 IronPDFは、C#プロジェクトにおいて、これらのタスクをプログラムによっても実行し、時間と労力を節約します。

それらを比較して、あなたのプロジェクトに最適なものを見つけましょう。


概要

IronPDFについて

IronPDF は C# HTML to PDF ライブラリです。 これはエンジニアがHTML文字列、Webページ、URLなどのソースからPDFファイルを作成するというタスクを実行できるようにします。また、ウォーターマーク、ブックマーク、ヘッダーやフッターなどのプロパティも設定できます。さらに、複数のPDFファイルを一つに結合したり、PDFページを画像に変換したり、その逆も可能です。

開発用には無料で提供され、30日間のデプロイトライアルがあり、プロジェクトの本番稼働に対応しています。

このリンクからファイルプロジェクトをダウンロードできます。

Accusoft PrizmDoc Viewerについて

PrizmDoc Viewerは、PDFファイルを操作し、それらを他の形式にリモートで変換するために使用されるREST APIです。 PrizmDocは、100以上の異なる形式のファイルをPDFに変換し、PDFをPNG、JPG、TIFF、およびSVGに変換することができます。 アプリケーションにさまざまな種類の電子署名オプションを含めるためにも使用できます。

比較表

IronPDF PrizmDoc Viewer
Work with PDF files programmatically. Work with PDF files programmatically.
Supports .NET core with Window, Mac, or Linux. Supports .NET Core using Window, Mac, or Linux.
Works Locally Sends Documents to a remote server.
Work with or without using Asynchronous Programming. Must use Asynchronous Programming using `System.Threading.Tasks`.
Easily work offline once we install IronPF in our system. Must connect with the internet to send the request to the PrizmDoc Viewer server (Cloud-hosted or self-hosted).
Provides many predefined functions. Provides some predefined functions.
Often requires minimal lines of code. Often requires many lines of code.
Unlimited conversions per project in each license plan. Limited number of transactions in each cloud-hosted license plan.
Free for development with no time limit. Only 300 transactions with trial.

次の2つをインストールしてコードを比較しましょう。


ステップ1:インストール

1. IronPDFライブラリをインストール

プロジェクトにIronPDFをインストールするには2つの方法がありますが、どちらを採用しても違いはありません。

1.1. IronPDF DLLをダウンロード

IronPDF.dllをダウンロードして、プロジェクトにその参照を追加してください。 その後、次の方法でIronPdfの名前空間に簡単にアクセスできます:

using IronPdf;

今、IronPDFの提供されている関数やクラスに簡単にアクセスできます。

NuGetパッケージマネージャーを使用したインストール

  • パッケージマネージャーコンソール:

    パッケージ マネージャー コンソールを使用している場合は、次のコマンドを実行してください:

    :ProductInstall
  • ソリューションのパッケージ管理:

    NuGet パッケージ マネージャーの GUI を使用している場合は、検索バーで IronPDF を参照してインストールします。


    AccusoftからPrizmDoc Viewerをインストールする

    PrizmDoc Viewerには2つの部分があり、1つはPrizmDoc Serverというサーバーサイドで、これはRestful APIとして機能します。 もう一つは、APIを叩いてレスポンスを取得するプロジェクトです。

    PrizmDoc サーバーにアクセスする

    名前からわかるように、これはサーバーサイドアプリケーションであり、ドキュメントをリクエスト(入力)として基本情報を取得し、ドキュメントをPDFファイルに変換した後、変換されたPDFファイルをクライアントにレスポンス(出力)として送信します。 それは製品の技術的な核であり、ドキュメント処理および変換エンジンです。2つの異なる方法で使用できますが、どちらを採用してもプログラミング構造と技術は同じです。

  1. セルフホスト:

    このオプションでは、サーバーを手配する必要があり、PrizmDoc Serverをダウンロードしてインストールできます。WindowsでのPrizmDoc Serverのインストール方法については、詳細はこちらをご覧ください。

    注意: 少なくとも32 GBのRAMと4コアのCPUが必要です。そうでない場合は、問題が生じる可能性があります。

  2. クラウドホスト:

    これはPrizmDoc Viewerのクラウドベースのサービスであり、サーバーを手配する必要はありません。 私たちはそれを比較に使用します。 これを行うには、アカウントを作成し、その後ホームページが開きます。 API keyAPI Key メニューからコピーできますが、後でその使い方を見ていきます。

    まず最初に、PrizmDoc Viewerを使用してドキュメントをPDFファイルに変換する基本的な構造を見ていきます。そして、C#コンソールアプリケーション内でWebClient()を使ってAccusoft serverと直接やり取りします。

    注意: 以下の例は、PrizmDocがPDFファイルを処理する方法の概念的な理解を得るためのものです。 少し長いので、この例を飛ばして直接比較に進んでも問題ありません。

    Accusoftワーキングストラクチャー

    この例では、myWebpage.htmlsample.pdf ファイルに変換します。

注: プロジェクトにNewtonsoftライブラリをインストールし、その参照を追加する必要があります。

まず、以下のライブラリをプロジェクトに追加してください:

using System;
using System.IO;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;//install Newtonsoft
using System;
using System.IO;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;//install Newtonsoft
Imports System
Imports System.IO
Imports System.Net
Imports System.Text
Imports System.Threading.Tasks
Imports Newtonsoft.Json.Linq 'install Newtonsoft
$vbLabelText   $csharpLabel

次に、公開変数Accusoft API Keyを作成し、次のようにAPIキーを貼り付けます:

static string ApiKey= "Your-API-KEY";
static string ApiKey= "Your-API-KEY";
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

PrizmDoc Viewerを使用してPDFファイルを処理するには3つのステップがあります:

  1. PrizmDocサーバーにファイルをアップロードします。

  2. アップロードされたファイルを変換する。

  3. 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)convertResults.SelectToken("state");

    //---Continuously checking whether conversion completed or not until 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)convertResults.SelectToken("state");

    //---Continuously checking whether conversion completed or not until 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(convertResults.SelectToken("state"))

	'---Continuously checking whether conversion completed or not until 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", "input");
    }
    var fileName = input.Name;
    var endpoint = new Uri("https://api.accusoft.com/PCCIS/V1/WorkFile");
    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 = "";
            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", "input");
    }
    var fileName = input.Name;
    var endpoint = new Uri("https://api.accusoft.com/PCCIS/V1/WorkFile");
    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 = "";
            getResult = Encoding.ASCII.GetString(results);
            return JObject.Parse(getResult);
        }
    }
}
Public Shared Async Function UploadToServer(ByVal fileToUpload As String) As Task(Of JObject)
	Dim input As New FileInfo(fileToUpload)
	If input Is Nothing Then
		Throw New ArgumentException("Missing parameter input", "input")
	End If
	Dim fileName = input.Name
	Dim endpoint = New Uri("https://api.accusoft.com/PCCIS/V1/WorkFile")
	Using client = New WebClient()
		client.Headers.Add("acs-api-key", ApiKey)
		client.Headers.Add("Content-Type", "application/octet-stream")
		Using reader = New BinaryReader(input.OpenRead())
			Dim data = reader.ReadBytes(CInt(reader.BaseStream.Length))
			Dim results = Await client.UploadDataTaskAsync(endpoint, "POST", data)
			Dim getResult As String = ""
			getResult = 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("https://api.accusoft.com/v2/contentConverters");
    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("https://api.accusoft.com/v2/contentConverters");
    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(ByVal affinityToken As String, ByVal fileID As String) As Task(Of JObject)
	Dim endpoint = New Uri("https://api.accusoft.com/v2/contentConverters")
	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 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 = "https://api.accusoft.com/v2/contentConverters/" + 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 = "https://api.accusoft.com/v2/contentConverters/" + 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(ByVal processId As String, ByVal affinityToken As String) As Task(Of JObject)
	Dim endpoint As String = "https://api.accusoft.com/v2/contentConverters/" & processId
	Using client = 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("https://api.accusoft.com/PCCIS/V1/WorkFile/" + 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("https://api.accusoft.com/PCCIS/V1/WorkFile/" + 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(ByVal affinityToken As String, ByVal fileId As String, ByVal outfile As String) As Task
	Dim endpoint = New Uri("https://api.accusoft.com/PCCIS/V1/WorkFile/" & fileId)

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

		Using writeStream = output.Create()
			Dim results = 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プロジェクトにインストールして使用する方法を見てみましょう。

Accusoft.PrizmDocServerSDKをインストールする

ラッパーをインストールする方法は二つあります。

  • パッケージマネージャーコンソール:

    次のコマンドを実行するには、パッケージマネージャーコンソールを使用してください:

    :InstallCmd install-package Accusoft.PrizmDocServerSDK
  • ソリューションのパッケージ管理:

    NuGet パッケージ マネージャーの GUI を使用している場合は、検索バーで Accusoft.PrizmDocServerSDK を参照してインストールしてください。

    これで、Accusoft.PrizmDocServer 名前空間に簡単にアクセスし、利用することができます。

    using Accusoft.PrizmDocServer;


    チュートリアルの方法

2. IronPDF 対 PrizmDoc Viewer コード比較

両方のコンポーネントの紹介とインストールを読んだ後、今度は両方のコンポーネントを使用する時です。 このために、いくつかのユースケースを取り上げ、両方のコンポーネントを使用して実装します。 これによってプログラミング構造の両方を簡単に理解し、プロジェクトに最適なものを決定する方法を提供できることを願っています。


3. HTMLをPDFファイルに変換

最初の比較では、myWebPage.htmlという名前のウェブページがあり、それをPDFファイルに変換してターゲットの場所に保存したいというユースケースを考えてみましょう。

3.1. IronPDF HTMLからPDFへの変換

/**
HTML to PDF
anchor-ironpdf-html-to-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");
}
/**
HTML to PDF
anchor-ironpdf-html-to-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");
}
'''
'''HTML to PDF
'''anchor-ironpdf-html-to-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フォルダに保存します。

このようにパスを指定することもできます:PDF.SaveAs("E:/sample.pdf");

詳しく読む IronPDFを使用してPDFファイルを扱う方法について。

次に、比較を簡単にするために、PrizmDoc Viewerを使用して同じタスクを実行します。

3.2. PrizmDoc Viewer HTML を PDF に変換

PrizmDoc Viewerのインストールでは、すでにAccusoft API Keyの取得方法について説明しましたが、これからその使用方法を見ていきます。

まず、PrizmDocサーバーにリクエストを送り、サーバーからのレスポンスを受け取ります。 このプロセスには時間がかかるため、非同期プログラミングを使用する必要があります。

注意: 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("https://api.accusoft.com", "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("https://api.accusoft.com", "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
Shared Sub Main(ByVal args() As String)
	ChromePdfRenderer().GetAwaiter().GetResult()
End Sub
Private Shared Async Function ChromePdfRenderer() As Task
	'instantiate PrizmDocServerClient object
	Dim prizmDocServer = New PrizmDocServerClient("https://api.accusoft.com", "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
$vbLabelText   $csharpLabel

PrizmDoc Viewer の操作方法について詳しく読む

HTML to PDF コード比較

以下の例から、IronPDFがPDFファイルを作成するためのより簡単なアプローチであり、それほど多くの時間を必要としないことがわかります。


4. 画像をPDFに変換

この比較では、使用ケースとして、プロジェクトのdebugフォルダーに存在する画像からPDFファイルを作成する必要があります。 IronPDFから始めましょう。

4.1. IronPDF 画像をPDFに変換

/**
Image to PDF
anchor-ironpdf-image-to-pdf
**/
using IronPdf;
static void Main(string [] args)
{
    //specify the image to be convert
    using var converted = ImageToPdfConverter.ImageToPdf("google.png");
    //save PDF file to the target location
    converted.SaveAs("sample.pdf");
}
/**
Image to PDF
anchor-ironpdf-image-to-pdf
**/
using IronPdf;
static void Main(string [] args)
{
    //specify the image to be convert
    using var converted = ImageToPdfConverter.ImageToPdf("google.png");
    //save PDF file to the target location
    converted.SaveAs("sample.pdf");
}
'''
'''Image to PDF
'''anchor-ironpdf-image-to-pdf
'''*
Imports IronPdf
Shared Sub Main(ByVal args() As String)
	'specify the image to be convert
	Dim converted = ImageToPdfConverter.ImageToPdf("google.png")
	'save PDF file to the target location
	converted.SaveAs("sample.pdf")
End Sub
$vbLabelText   $csharpLabel

出力:

このスクリーンショットは、上記のコードを使用して新たに作成されたPDFファイルsample.pdfのものです。

Iron 2 related to 4.1. IronPDF 画像をPDFに変換

IronPDF を使用して画像から PDF ファイルを作成するのがいかに簡単かを確認できます。 次に、PrizmDoc Viewerを使用して同じタスクを実行し、その生成されたPDFファイルを確認します。

4.2. PrizmDoc Viewer イメージをPDFに変換

static void Main(string [] args)
{
    ImageToPDF().GetAwaiter().GetResult();
}
private static async Task ImageToPDF()
{
    //instantiate PrizmDocServerClient object
    var prizmDocServer = new PrizmDocServerClient("https://api.accusoft.com", "Your-API-KEY");
    //specify the image to be convert
    ConversionResult results = await prizmDocServer.ConvertToPdfAsync("google.png");
    //save pdf file to the target location
    await results.RemoteWorkFile.SaveAsync("sample.pdf");
}
static void Main(string [] args)
{
    ImageToPDF().GetAwaiter().GetResult();
}
private static async Task ImageToPDF()
{
    //instantiate PrizmDocServerClient object
    var prizmDocServer = new PrizmDocServerClient("https://api.accusoft.com", "Your-API-KEY");
    //specify the image to be convert
    ConversionResult results = await prizmDocServer.ConvertToPdfAsync("google.png");
    //save pdf file to the target location
    await results.RemoteWorkFile.SaveAsync("sample.pdf");
}
Shared Sub Main(ByVal args() As String)
	ImageToPDF().GetAwaiter().GetResult()
End Sub
Private Shared Async Function ImageToPDF() As Task
	'instantiate PrizmDocServerClient object
	Dim prizmDocServer = New PrizmDocServerClient("https://api.accusoft.com", "Your-API-KEY")
	'specify the image to be convert
	Dim results As ConversionResult = Await prizmDocServer.ConvertToPdfAsync("google.png")
	'save pdf file to the target location
	Await results.RemoteWorkFile.SaveAsync("sample.pdf")
End Function
$vbLabelText   $csharpLabel

出力: このスクリーンショットは、上記のコードから新しく作成されたPDFファイルsample.pdfのものです。

Prizm 2 related to 4.2. PrizmDoc Viewer イメージをPDFに変換

4.3. 画像からPDFへのコード比較

私たちが見る限り、IronPDFを使用して2行の簡単なコードを書く必要があるだけです。 一方、PrizmDocサーバーを使用する場合は、非同期プログラミングを使って多くのコード行を記述する必要があります。 IronPDFの出力は、自動的に使用可能な全ページのドキュメントを提供します。


5. PDFファイルの結合

この比較において、A.pdfB.pdfC.pdfという名前の3つのPDFファイルがあると仮定しましょう。 これらを1つのPDFファイルに統合したいと思いますが、このタスクは両方のコンポーネントを使用して実行できます。 まず、IronPDFを使用してこのタスクを実行する方法を確認します。

5.1. IronPDF PDFファイルの結合

/**
Merge PDF Files
anchor-ironpdf-merge-pdf-files
**/
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();
    }
}
/**
Merge PDF Files
anchor-ironpdf-merge-pdf-files
**/
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();
    }
}
'''
'''Merge PDF Files
'''anchor-ironpdf-merge-pdf-files
'''*
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

上記のコードは、A.pdfB.pdfC.pdfの組み合わせであるsample.pdfファイルを作成します。

次に、PrizmDoc Viewerを使用して同じタスクを行います。

5.2. 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("https://api.accusoft.com", "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("https://api.accusoft.com", "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

Shared Sub Main(ByVal args() As String)
	PdfMerge().GetAwaiter().GetResult()
End Sub
Private Shared Async Function PdfMerge() As Task
	'instantiate PrizmDocServerClient object
	Dim prizmDocServer = New PrizmDocServerClient("https://api.accusoft.com", "Your-API-KEY")
	'pass the list of pdf files to PrizmDoc Server
	Dim result As ConversionResult = Await prizmDocServer.CombineToPdfAsync({
		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
$vbLabelText   $csharpLabel

上記のコードは、A.pdfB.pdf、およびC.pdfファイルを組み合わせたsample.pdfファイルも作成します。


6. PDFヘッダーとフッター

この比較では、myWebPage.htmlという名前のシンプルなWebページがあり、次の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

このウェブページをPDFファイルに変換し、以下のヘッダーとフッターのプロパティを設定したいと思います:

  • ページタイトルはヘッダーの左側にあります
  • ヘッダーの右側にあるDateTime
  • フッターの右側に総ページ数のページ番号があります。

    まず、IronPDFを使ってヘッダーとフッターを設定する方法について見ていきます。

6.1. IronPDF のPDF ヘッダーおよびフッター

PDFファイルのヘッダーとフッターを処理するために、IronPDFはChromePdfRendererクラスにRenderingOptionsというプロパティを提供しています。これは次のように使用できます:

  • ヘッダー用:

    C# ChromePdfRenderer_Obj.RenderingOptions.TextHeader=new TextHeaderFooter()

  • フッター用:

    C# ChromePdfRenderer_Obj.RenderingOptions.TextFooter=new TextHeaderFooter()

    次のプロパティは、TextHeaderFooter() を初期化する際に設定できます:

  • CenterTextを使用して、ヘッダーまたはフッターの中央にテキストを印刷します。
  • LeftText は、ヘッダーまたはフッターの左側にテキストを印刷するためのものです。
  • RightTextは、ヘッダーまたはフッターの右側にテキストを印刷します。
  • DrawDividerLine は、ページのコンテンツをヘッダーまたはフッターから分離する線を描画します。
  • FontFamily は、ヘッダーまたはフッターのフォントファミリーを指定します。
  • FontSize は、ヘッダーまたはフッターのフォントサイズを指定します。
  • スペーシング は、ページの内容とヘッダーまたはフッターの間のスペースを調整します。

    次のいくつかの事前定義された属性は、ヘッダーやフッターのコンテンツを設定するのに非常に役立ちます。 以下のように波括弧 { } に書くことができます:

  • {page} は、ヘッダーまたはフッターに現在のページ番号を印刷します。
  • {total-pages} は、ヘッダーまたはフッターにページの合計数を印刷します。
  • {url} は、レンダリングされたページのURLを印刷するために使用されます。
  • {date} は、ヘッダーまたはフッターに現在の日付を印刷します。
  • {time} は、ヘッダーまたはフッターに現在の時刻を印刷します。
  • {html-title} は、レンダリングされたウェブページのタイトルをヘッダーまたはフッターに印刷します
  • {pdf-title} はヘッダーまたはフッターにドキュメントのタイトルを印刷します。

    詳細を読む IronPDFを使用してヘッダーとフッターを操作する方法について詳しく説明しています。

    以下の例を見て、ユースケースを実装し、上記のプロパティを使用してPDFファイルのヘッダーとフッターを設定する方法を示しましょう。

/**
Set Header and Footer
anchor-ironpdf-pdf-header-and-footer
**/
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");
}
/**
Set Header and Footer
anchor-ironpdf-pdf-header-and-footer
**/
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");
}
'''
'''Set Header and Footer
'''anchor-ironpdf-pdf-header-and-footer
'''*
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のスクリーンショット:

Iron Hdr Ftr related to 6.1. IronPDF のPDF ヘッダーおよびフッター

IronPDF を使用して PDF ファイルを作成する際に、ヘッダーとフッターを直感的な言語で簡単に操作できることがわかります。 次に、HeaderおよびFooterを設定するためにPrizmDoc Viewerを使用する方法を見てみましょう。

6.2. PrizmDoc Viewer PDFヘッダーとフッター

PrizmDoc Viewerは、HeaderFooterOptionsクラスを提供してヘッダーとフッターを扱います。以下のプロパティがあります:

  • ヘッダーおよびフッターの行を指定します(次の例を理解するとより明確になります)。各行には次のプロパティがあります:

    • は、ヘッダーまたはフッター行の左側にテキストを印刷します。

    • Center はテキストをヘッダーまたはフッターラインの左側に印刷します。
  • Right は、テキストをヘッダーまたはフッター行の右側に印刷します。
  • 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("https://api.accusoft.com", "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("https://api.accusoft.com", "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
Shared Sub Main(ByVal args() As String)
	SetHeaderFooter().GetAwaiter().GetResult()
End Sub
Private Shared Async Function SetHeaderFooter() As Task
	'instantiate PrizmDocServerClient object with Header and footer properties
	Dim prizmDocServer = New PrizmDocServerClient("https://api.accusoft.com", "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
$vbLabelText   $csharpLabel

出力:

上記のコードによって作成された新しいPDFファイルのスクリーンショット:

Prizm Hdr Ftr related to 6.2. PrizmDoc Viewer PDFヘッダーとフッター

6.3. PDFヘッダーとフッターのコード比較

IronPDFは、PrizmDoc Viewerと比較して、ヘッダーおよびフッターのプロパティを設定するための機能をシンプルなプログラミング構造でより多く提供していることがわかります。 IronPDFで生成されたPDFファイルは、PrizmDoc Viewerで生成されたファイルよりも読みやすく魅力的であるとされています。


PDFページを画像に変換

別のユースケースを考えてみましょう。Sample_PDF.pdfという名前のシンプルなPDFファイルがあり、これは2ページだけです。

Page1 Page2
Page 1 related to PDFページを画像に変換
Page 1 related to PDFページを画像に変換

そして、各ページの画像を作成する必要があります。 まず、IronPDFを使用してこのタスクを実行する方法を確認します。

7.1. IronPDFを使用してPDFを画像に変換する

/**
PDF to Image
anchor-ironpdf-convert-pdf-to-image
**/
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");
}
/**
PDF to Image
anchor-ironpdf-convert-pdf-to-image
**/
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");
}
'''
'''PDF to Image
'''anchor-ironpdf-convert-pdf-to-image
'''*
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

出力:

上記のコードは、以下の2つの.png画像を作成します。

Page1 Image Page2 Image
Iron Generated Image1 related to 7.1. IronPDFを使用してPDFを画像に変換する
Iron Generated Image2 related to 7.1. IronPDFを使用してPDFを画像に変換する

IronPDFを使用して各PDFページの画像を作成するのが非常に簡単であることがわかります。 次に、PrizmDoc Viewerを使用して同じタスクを行います。

7.2. PrizmDoc Viewer PDF to Image

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("https://api.accusoft.com", "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("https://api.accusoft.com", "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
Shared Sub Main(ByVal args() As String)
	PdfToImage().GetAwaiter().GetResult()
End Sub
Private Shared Async Function PdfToImage() As Task
	'instantiate PrizmDocServerClient object
	Dim prizmDocServer = New PrizmDocServerClient("https://api.accusoft.com", "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 i
End Function
$vbLabelText   $csharpLabel

出力:

上記のコードは、次の2つの.png画像も作成します:

Page1 Page2
Prizm Generated Image1 related to 7.2. PrizmDoc Viewer PDF to Image
Prizm Generated Image2 related to 7.2. PrizmDoc Viewer PDF to Image

7.3. PDF to Image コード比較

PrizmDoc Viewerと比較して、IronPDFを使用すると、ページを繰り返し処理することなく、最小限のコード行数で各ページの画像を簡単に作成できます。


8. ライセンス価格設定

上記の比較では、両方のコンポーネントの技術的な構造と提供される機能を確認できます。 それでは、両方のコンポーネントのライセンス料金について見ていきましょう。 私たちは常に予算を最小限に抑えながら要件を満たすことを目指しているため、これは非常に重要です。

8.1. IronPDF ライセンスオプション

IronPDFのライセンスは、1人の開発者による単一プロジェクト用で$749から開始されます。

あなたが企業または複数のクライアントにサービスを提供する代理店のエンジニアである場合、ライセンスは$699から開始し、チームの規模やプロジェクトの数に応じて調整可能です。

以下のライセンスは一回限りの支払いが必要です。

Number of Developers Price
1-5 $699
6-10 $799
11-20 $899
21-50 $999
Unlimited $1,199
  • 複数の拠点を持つ企業の場合、ライセンスは$1199から始まります。
  • SaaSサービスの場合、ライセンスは1,099ドルから始まります。
  • ロイヤリティフリーのOEM再配布のためのライセンスは$1599から始まります。

    注: 上記のすべてのライセンスパッケージには、1年間のサポートとアップデートが含まれています。

    詳細を読む IronPDFのすべてのライセンスパッケージについて。

8.2. PrizmDoc Viewerライセンスオプション

セルフホスティングオプション

サーバーを管理している場合、ライセンスの価格は年額 $7,900で標準サポートが含まれます。

詳細はこちら をご覧ください。PrizmDoc Viewerのすべての提供パッケージ情報について。

クラウドベースのオプション

このライセンスは、トランザクションの数に基づいてスケーリングされるPrizmDoc Viewerのクラウドベースのサービスを対象としています。

用語:

Transactionは、PrizmDoc Viewerサーバーにリクエストを送信し、出力(生成されたドキュメント)を取得することを意味します。

Prepaid Bucketsは、一度支払うことで取引を取得でき、それは期限切れになりません。

No of Transactions Prepaid Buckets Monthly Annually
200 $18
1,000 $89
2,000 $119
6,000 $254 $169 $1,859 (6,000 Transactions/Month)
12,000 $434 $289 $3,179 (12,000 Transactions/Month)
25,000 $749 $749 $5,459 (25,000 Transactions/Month)
50,000 $1,199 $799 $8,789 (50,000 Transactions/Month)
100,000 $1,499 $999 $10,989 (100,000 Transactions/Month)
200,000 $2,549 $1,699 $19,188 (200,000 Transactions/Month)
300,000 $3,299 $2,199 $25,188 (300,000 Transactions/Month
400,000 $4,049 $2,699 $31,188 (400,000 Transactions/Month)
500,000 $4,799 $3,199 $37,188 (500,000 Transactions/Month)

チュートリアル クイック アクセス

Html To Pdf Icon related to チュートリアル クイック アクセス

C# IronPDF クイックスタートハンドブックを入手

私たちは、.NETでのPDF開発を簡単にするための無料PDFリソースガイドを作成しました。このガイドには、共通の機能のチュートリアルや、C#およびVB.NETでPDFを操作、編集、生成、保存するための例が含まれています。

ガイドをダウンロード

IronPDF APIリファレンスを探索する

IronPDF C# ライブラリのAPIリファレンスを探索し、IronPDFのすべての機能、クラス、メソッドフィールド、名前空間、および列挙型の詳細を確認してください。

APIリファレンスを表示
Documentation related to チュートリアル クイック アクセス
チペゴ
ソフトウェアエンジニア
チペゴは優れた傾聴能力を持ち、それが顧客の問題を理解し、賢明な解決策を提供する助けとなっています。彼は情報技術の学士号を取得後、2023年にIron Softwareチームに加わりました。現在、彼はIronPDFとIronOCRの2つの製品に注力していますが、顧客をサポートする新しい方法を見つけるにつれて、他の製品に関する知識も日々成長しています。Iron Softwareでの協力的な生活を楽しんでおり、さまざまな経験を持つチームメンバーが集まり、効果的で革新的な解決策を提供することに貢献しています。チペゴがデスクを離れているときは、良い本を楽しんだり、サッカーをしていることが多いです。
< 以前
PDFSharp HTML to PDF の例とチュートリアルの比較
次へ >
IronPDFとPDFCrowdの比較