製品比較

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

更新済み 9月 2, 2021
共有:

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

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


概要

IronPDFについて

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

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

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

Accusoft PrizmDoc Viewerについて

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

比較表

IronPDF PrizmDocビューア
プログラムでPDFファイルを操作する。 プログラムでPDFファイルを操作する。
Windows、Mac、またはLinuxを使用した.NET Coreをサポートします。 Windows、Mac、またはLinuxを使用した.NET Coreをサポートします。
ローカルで動作します ドキュメントをリモートサーバーに送信します。
非同期プログラミングを使用しても使用しなくても作業できます。 `System.Threading.Tasks` を使用して非同期プログラミングを行う必要があります。
IronPDFをシステムにインストールすると、簡単にオフライン作業ができます。 Must connect with the internet to send the request to the PrizmDocビューア server (Cloud-hosted or self-hosted).
多くの定義済み関数が提供されます。 いくつかの事前定義された関数を提供します。
多くの場合、必要なコード行はわずかです。 しばしば多くのコード行を必要とします。
各ライセンスプランにおけるプロジェクトごとの無制限な変換。 各クラウドホステッドライセンスプランには、トランザクションの数に制限があります。
開発用は無料で、時間制限はありません。 試用版では300件の取引のみ。

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


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

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

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

1.1. IronPDF DLLをダウンロード

IronPDF.dllをダウンロード プロジェクトにリファレンスを追加します。 この後、次の方法でIronPdfの名前空間に簡単にアクセスできます:

using IronPdf;

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

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

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

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

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

    IronPDF for .NET、Java、Python、Node.jsのGUIを使用している場合 NuGet パッケージマネージャー, 次に検索バーで IronPDF を検索してインストールします。


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

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

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

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

  1. Self-Hosted: 自己ホスト型

    以下のオプションについては、サーバーを設定する必要があります。また、 PrizmDoc Serverをダウンロード 次に、それをインストールします。続きを読む WindowsにPrizmDoc Serverをインストールする方法について

    注: 最低でも32GBのRAMと4コアのCPUが必要です。そうでない場合は、悪い経験をする可能性があります。

  2. クラウドホスティング:

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

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

    以下の例は、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
VB   C#

次に、パブリック変数 Accusoft API Key を作成し、以下のようにAPIキーを貼り付けます: もちろんです!翻訳したいコンテンツを提供してください。それに従って正確な日本語訳を提供いたします。

static string ApiKey = "Your-API-KEY";
static string ApiKey = "Your-API-KEY";
Private Shared ApiKey As String = "Your-API-KEY"
VB   C#

もちろんです!翻訳したいコンテンツを提供してください。それに従って正確な日本語訳を提供いたします。

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
VB   C#

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
VB   C#

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
VB   C#

以下の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
VB   C#

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
VB   C#

上記の例は多大な努力を要します。! 業務負荷を最小限に抑えるために、Accusoftは .NET ライブラリを導入しました。 Accusoft.PrizmDocServerSDK、これは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
VB   C#

上記のコードは、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
VB   C#

続きを読む PrizmDoc Viewerの使い方について

HTML to PDF コード比較

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


4. 画像をPDFに変換

今回の比較では、PDFファイルを作成する必要があるケースを取り上げます。 画像およびプロジェクトの debug フォルダーに存在します。 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
VB   C#

出力:

このスクリーンショットは、上記のコードを使用して新しく作成されたPDFファイル sample.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
VB   C#

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

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

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


5. PDFファイルの結合

この比較において、A.pdfB.pdf、およびC.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
VB   C#

上記のコードは、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
VB   C#

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


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

この比較では、HTMLとCSSが以下のようなシンプルなWebページ myWebPage.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>
<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ファイルに変換し、以下のヘッダーとフッターのプロパティを設定したいと思います:

  • ヘッダーの左側にある「Page Title」
  • ヘッダーの右側の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 を使用します。

  • スペーシングは、ページコンテンツとヘッダーまたはフッターの間のスペースを調整します。

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

  • **{ページ}ヘッダーまたはフッターに現在のページ番号を印刷します。
  • **{総ページ数}ヘッダーまたはフッターに総ページ数を印刷します。
  • **{URL}レンダリングされたページのURLを印刷するために使用されました。
  • {日付} ヘッダーまたはフッターに現在の日付を印刷します。
  • **{時間}ヘッダーまたはフッターに現在の時刻を印刷します。
  • {html-タイトル}レンダリングされたウェブページのタイトルをヘッダーまたはフッターに印刷します。**

  • **{pdfタイトル}ヘッダーまたはフッターにドキュメントのタイトルを印刷します。

    続きを読む 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
VB   C#

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

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

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

PrizmDoc Viewerは、ヘッダーとフッターを処理するために HeaderFooterOptions クラスを提供しており、次のプロパティがあります:

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

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

    • 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
VB   C#

出力:

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

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

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


PDFページを画像に変換

もう一つの使用例を考えてみましょう。2ページしかないシンプルなPDFファイル Sample_PDF.pdf があるとします。

ページ1 ページ2

そして、各ページの画像を作成する必要があります。 まず、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
VB   C#

出力:

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

ページ1 画像 ページ2 画像

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

7.2. PrizmDoc Viewer PDF to Image

プログラムでPDFを画像として表示するためには、IronPDFを利用するのが簡単で効果的な方法です。以下の手順に従ってください。

  1. PdfDocumentオブジェクトをIronPDFで作成します。
  2. pdfDocument.RenderAsImagesメソッドを使用して、PDFページを画像としてレンダリングします。
  3. 生成された画像をビューアや他のUIコンポーネントに表示します。

以下は、IronPDFを使ったC#のコードサンプルです。

using IronPdf;

var pdfDocument = PdfDocument.FromFile("example.pdf");
var images = pdfDocument.RenderAsImages(300); // 300 DPIでレンダリング

// 各画像をファイルとして保存
for (int i = 0; i < images.Length; i++)
{
    images[i].SaveAs($"page-{i+1}.png");
}
using IronPdf;

var pdfDocument = PdfDocument.FromFile("example.pdf");
var images = pdfDocument.RenderAsImages(300); // 300 DPIでレンダリング

// 各画像をファイルとして保存
for (int i = 0; i < images.Length; i++)
{
    images[i].SaveAs($"page-{i+1}.png");
}
Imports IronPdf

Private pdfDocument = PdfDocument.FromFile("example.pdf")
Private images = pdfDocument.RenderAsImages(300) ' 300 DPIでレンダリング

' 各画像をファイルとして保存
For i As Integer = 0 To images.Length - 1
	images(i).SaveAs($"page-{i+1}.png")
Next i
VB   C#

上記のコードでは、PDFが300 DPIで画像に変換され、それぞれのページが個別のPNGファイルとして保存されます。IronPDFを使って、迅速かつ確実に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("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
VB   C#

出力:

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

ページ1 ページ2

7.3. PDF to Image コード比較

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


8. ライセンス価格設定

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

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

IronPDFのライセンスは、1つのプロジェクトに対して1人の開発者向けの$749から始まります。

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

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

開発者数 価格
1-5 $699
6-10 $799
11-20 $899
21-50 $999
無制限 $1,199
  • 複数の拠点を持つ企業の場合、ライセンスは$1199からとなります。
  • SaaSサービスの場合、ライセンスは$1099から開始します。

  • OEM再配布のロイヤリティフリーのライセンスは$1599から始まります。

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

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

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

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

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

続きを読む PrizmDoc Viewerのすべての提供パッケージ情報について

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

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

用語集:

トランザクション」とは、PrizmDoc Viewerサーバーにアクセスし、出力を取得することを意味します。 (変換されたドキュメント).

「Prepaid Buckets」は、一度支払うと取引が行われることを意味し、有効期限がありません。

トランザクション数 プリペイドバケツ 月次 年次
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 `$Lite License` `$Lite License` $5,459(25,000トランザクション/月)
50,000 $1,199 $799 $8,789(月間50,000トランザクション)
100,000 $1,499 $999 $10,989(100,000取引/月)
200,000 $2,549 $1,699 $19,188 (月間 200,000 トランザクション)
300,000 (三十万) $3,299 $2,199 $25,188 (300,000 (三十万) Transactions/Month
400,000 $4,049 $2,699 $31,188 (月間400,000トランザクション)
500,000 $4,799 $3,199 月間500,000トランザクション ( $37,188 )

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

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

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

ガイドをダウンロード

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

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

APIリファレンスを表示
< 以前
PDFSharp HTML to PDF の例とチュートリアルの比較
次へ >
IronPDFとPDFCrowdの比較

準備はできましたか? バージョン: 2024.9 新発売

無料のNuGetダウンロード 総ダウンロード数: 10,659,073 View Licenses >