IronPDFをリモートコンテナとして実行する
IronPdfEngineは、PDFの作成、書き込み、編集、および読み取りを処理できるスタンドアロンサービスです。 IronPDF Dockerは、互換性のあるバージョンのIronPDF(v2023.2.x以降)を使用してDockerサービスを実行する準備が整っています。 これにより、開発者はIronPDFの使用中に発生している可能性のあるデプロイメントの問題を解消できるようになります。
IronPDFを独自のコンテナとして実行することが推奨される理由
IronPDFは動作するためにChromeとPDFiumの両方のバイナリを必要としますが、これらはファイルサイズが非常に大きいです(数百MB)。 また、マシンにいくつかの依存関係をインストールする必要があります。
この方法を使用することで、クライアントのファイルサイズは(MB単位で)ごくわずかな容量に抑えられます。
デプロイメントの問題を回避する
すべての依存関係を適切に含めるように環境やコンテナを設定するのは、難しい場合があります。 IronPDF Docker コンテナを使用すると、IronPDF が_あらかじめインストール済み_で、_確実に動作する_ため、デプロイや依存関係に関するあらゆる煩わしさを回避できます。
バージョン
IronPDF Dockerタグは、IronPdfEngine自体のバージョンに基づいています。 これはIronPDF製品とは異なるバージョンです。
各IronPDFバージョンには、それぞれ対応するIronPdfEngineバージョンがあります。 バージョン番号は、IronPDF Dockerのバージョンと一致させる必要があります。
例えば、IronPDF for Java バージョン 2023.2.1 には、IronPdfEngine バージョン 2023.2.1 が必要です。 IronPdfEngineとIronPDFのバージョンが一致していないものを使用することはできません。
IronPDF Docker の使用方法
IronPDFをインストールする
プロジェクトに IronPdf.Slim NuGet パッケージを追加してください。
https://www.nuget.org/packages/IronPdf.Slim/
注:IronPdf.Linux、および IronPdf.MacOs パッケージには、すべて IronPdf.Slim が含まれています。
アプリケーションのサイズを縮小するには、IronPdf.Slimのみをインストールすることをお勧めします。 パッケージ IronPdf.Native.Chrome.xxx は使用されなくなったため、プロジェクトから削除しても構いません。
必要なコンテナバージョンの特定
デフォルトでは、Docker版IronPDFのバージョンは、NuGet上のIronPDFの最新バージョンと一致します。 以下のコードを使用して、手動でバージョンを確認することができます:
string ironPdfEngineVersion = IronPdf.Installation.IronPdfEngineVersion;Dim ironPdfEngineVersion As String = IronPdf.Installation.IronPdfEngineVersionDim ironPdfEngineVersion As String = IronPdf.Installation.IronPdfEngineVersionDockerコンテナ用IronPDFの設定
Docker Compose なし
前の手順で指定したバージョンを使用して、Dockerコンテナを実行してください。
- Dockerがインストールされている必要があります。
セットアップ
- 以下のページにアクセスしてください https://hub.docker.com/r/ironsoftwareofficial/ironpdfengine
- 最新の ironsoftwareofficial/IronPdfEngine イメージを取得する
docker pull ironsoftwareofficial/ironpdfengine
または、特定のバージョンを取得する(推奨)
docker pull ironsoftwareofficial/ironpdfengine:2025.3.6
- ironsoftwareofficial/IronPdfEngine コンテナを実行します。
このコマンドはコンテナを作成し、ポート 33350 でバックグラウンドで実行します
docker run -d -p 33350:33350 -e IRONPDF_ENGINE_LICENSE_KEY=MY_LICENSE_KEY ironsoftwareofficial/ironpdfengine:2025.3.6
IronPdfEngine のランタイムパラメータはどのように設定しますか?
実行時パラメータは、イメージ名の後に key=value のペアとしてコンテナに直接渡すことができます。 これらは、イメージを再構築することなくエンジンの動作を設定します。
docker run -d -p 33350:33350 ironsoftwareofficial/ironpdfengine:2025.3.6 \
license_key="YOUR_LICENSE_KEY" \
enable_debug=true \
chrome_browser_limit=8
以下のパラメータが利用可能です:
| パラメータ | タイプ | Default | 説明 |
|---|---|---|---|
port | int | 33350 | gRPC リスニングポート |
license_key | string | - | IronPDF ライセンスキー |
enable_debug | bool | false | 完全なデバッグログを有効にする |
log_path | path | - | ログファイルのパス(完全なデバッグログの記録も有効になります) |
logging_mode | string | Console | ロギングモード: なし、コンソール、カスタム、DebugOutputWindow、ファイル、すべて |
chrome_browser_limit | int | - | Chromeブラウザの最大同時起動数 |
chrome_cache_path | path | - | Chromeブラウザのキャッシュ用ディレクトリ |
chrome_gpu_mode | int | 0 | GPUモード: 0 無効、1 ハードウェア、2 ハードウェアフル、3 ソフトウェア |
chrome_custom_deployment_dir | path | - | Chrome 展開用バイナリ用のカスタムディレクトリ |
temp_folder_path | path | - | 一時ディレクトリを上書きする |
skip_shutdown | bool | false | アイドル時にエンジンが停止しないようにする |
skip_initialization | bool | false | 起動時のChrome/PDFiumの初期化をスキップする |
keep_alive | bool | false | クライアントが切断した後もエンジンを稼働させ続ける |
single_process | bool | - | Chromeをシングルプロセスモードで実行する |
linux_and_docker_auto_config | bool | true | Linux/Dockerの依存関係を自動設定(Dockerのエントリポイントによって自動的に設定されます) |
send_anonymous_analytics_and_crash_data | bool | - | 匿名テレメトリを有効または無効にする |
linux_and_docker_auto_config パラメータは、Dockerのエントリポイントによって自動的に true に設定されます。 手動で提出する必要はありません。 (ホストがGPUパススルーを提供していない限り、Docker内のchrome_gpu_modeは0(無効)のままにしてください。また、Docker Compose では、IRONPDF_ENGINE_LICENSE_KEY 環境変数を使用して、-e または environment: 経由でライセンスキーを設定することもできます。 コマンドライン引数と環境変数が両方設定されている場合、コマンドライン引数が優先されます。
翻訳例:
docker run -d --restart=unless-stopped \
-p 33350:33350 \
-e IRONPDF_ENGINE_LICENSE_KEY=MY_KEY \
ironsoftwareofficial/ironpdfengine \
chrome_browser_limit=8 skip_shutdown=true
デバッグの例:
docker run -p 33350:33350 \
ironsoftwareofficial/ironpdfengine \
enable_debug=true log_path=/app/logs/engine.log
Docker Compose を使用する場合
重要なのは、IronPdfEngineとアプリケーションが相互に通信できるようにするDockerネットワークを設定することです。 アプリケーションの起動前に IronPdfEngine が起動していることを確認するには、'depends_on' を設定してください。
セットアップ
- まず、
docker-compose.ymlファイルを作成します。以下のテンプレートを使用して、Docker Compose ファイルを設定してください:
version: '3.6'
services:
myironpdfengine:
container_name: ironpdfengine
image: ironsoftwareofficial/ironpdfengine:latest
ports:
- '33350:33350'
networks:
- ironpdf-network
myconsoleapp:
container_name: myconsoleapp
build:
# enter YOUR project directory path here
context: ./MyConsoleApp/
# enter YOUR dockerfile name here, relative to project directory
dockerfile: Dockerfile
networks:
- ironpdf-network
depends_on:
myironpdfengine:
condition: service_started
networks:
ironpdf-network:
driver: 'bridge'
- アプリケーション(myconsoleapp)内で、IronPdfEngineのアドレスを"myironpdfengine:33350"に設定してください。
- Docker Compose を実行する
docker compose up --detach --force-recreate --remove-orphans --timestamps
IronPdfEngine に接続する
IronPDFのコードを実行してください; あなたのアプリは、Docker上のIronPdfEngineと通信できるようになりました!
using IronPdf;
using IronPdf.GrpcLayer;
// Configure for Docker container
var config = IronPdfConnectionConfiguration.Docker;
config.Host = "localhost";
IronPdf.Installation.ConnectToIronPdfHost(config);
// Use IronPDF
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Hello IronPDF Docker!<h1>");
pdf.SaveAs("ironpdf.pdf");using IronPdf;
using IronPdf.GrpcLayer;
// Configure for Docker container
var config = IronPdfConnectionConfiguration.Docker;
config.Host = "localhost";
IronPdf.Installation.ConnectToIronPdfHost(config);
// Use IronPDF
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Hello IronPDF Docker!<h1>");
pdf.SaveAs("ironpdf.pdf");Imports IronPdf
Imports IronPdf.GrpcLayer
' Configure for Docker container
Private config = IronPdfConnectionConfiguration.Docker
config.Host = "localhost"
IronPdf.Installation.ConnectToIronPdfHost(config)
' Use IronPDF
Dim renderer As New ChromePdfRenderer()
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>Hello IronPDF Docker!<h1>")
pdf.SaveAs("ironpdf.pdf")Imports IronPdf
Imports IronPdf.GrpcLayer
' Configure for Docker container
Private config = IronPdfConnectionConfiguration.Docker
config.Host = "localhost"
IronPdf.Installation.ConnectToIronPdfHost(config)
' Use IronPDF
Dim renderer As New ChromePdfRenderer()
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>Hello IronPDF Docker!<h1>")
pdf.SaveAs("ironpdf.pdf")接続タイプ
接続タイプに応じて、いくつかの IronPdfConnectionType を割り当てることができます。
利用可能なプロパティの一覧は以下の通りです:
LocalExecutable: ローカルマシン上で実行されているIronPdfEngineの"サーバー"に接続するには、このオプションを使用します。 簡単な例として、クラウドサービスに依存せずにローカルでPDFを生成するWinFormsの請求書作成アプリケーションが挙げられます。
Docker: このオプションは、ローカルまたはクラウド上の Docker コンテナに接続しようとする場合に使用します。
RemoteServer: このオプションは、クラウド上の IronPdfEngine で使用されます。 これは、HTTPまたはHTTPSプロトコルを介して、クラウドホスト型(例:Docker)のIronPdfEngineインスタンスに接続します。 なお、これはリモートサーバーへの接続であるため、完全なURL(HTTPまたはHTTPSプロトコルを含む)が必要です。
カスタム: 接続を完全に制御およびカスタマイズしたい場合は、このオプションを使用できます。 このオプションでは、上記の他の定義済みオプションの代わりに、ユーザーが独自に定義した Grpc.Core.ChannelBase を使用します。 開発者は、新しい Grpc.Core.Channel オブジェクトを作成するか、Grpc.Net.Client.GrpcChannel.ForAddress(System.String) を使用することで、gRPC チャネルを完全に制御し、カスタマイズすることができます。
.NET Framework(NetFrameworkChannel 付き)
.NET Frameworkについては、gRPCの動作が.NET Frameworkプロジェクトでは異なるため、別途設定が必要です。 このメソッドが動作するには、Grpc.Core NuGet パッケージがインストールされていることを確認してください。 この特定の構成では、Grpc.Core.ChannelBase を継承したカスタム gRPC チャネルを使用します。
ここでは、IronPdfEngineを使用してPDFを作成・保存するための接続チャネルを実装する例を見てみましょう。
<http> または <https> というプレフィックスを削除してみてください。pdf.Dispose が必須であることにご留意ください。using IronPdf;
// This code demonstrates how to use IronPdf with gRPC in a .NET Framework application.
// 1. Configure connection to use local IronPdfEngine executable
var config = IronPdf.GrpcLayer.IronPdfConnectionConfiguration.Executable;
// 2. Connect to the IronPDF host with the executable configuration
IronPdf.Installation.ConnectToIronPdfHost(config);
// 3. Create a PDF renderer instance
ChromePdfRenderer renderer = new ChromePdfRenderer();
// 4. Render HTML string as PDF document
PdfDocument pdf = renderer.RenderHtmlAsPdf("Hello world");
// 5. Save the PDF to disk
pdf.SaveAs("output.pdf");
// 6. Clean up , this is needed to work
pdf.Dispose();using IronPdf;
// This code demonstrates how to use IronPdf with gRPC in a .NET Framework application.
// 1. Configure connection to use local IronPdfEngine executable
var config = IronPdf.GrpcLayer.IronPdfConnectionConfiguration.Executable;
// 2. Connect to the IronPDF host with the executable configuration
IronPdf.Installation.ConnectToIronPdfHost(config);
// 3. Create a PDF renderer instance
ChromePdfRenderer renderer = new ChromePdfRenderer();
// 4. Render HTML string as PDF document
PdfDocument pdf = renderer.RenderHtmlAsPdf("Hello world");
// 5. Save the PDF to disk
pdf.SaveAs("output.pdf");
// 6. Clean up , this is needed to work
pdf.Dispose();Imports IronPdf
' This code demonstrates how to use IronPdf with gRPC in a .NET Framework application.
' 1. Configure connection to use local IronPdfEngine executable
Dim config = IronPdf.GrpcLayer.IronPdfConnectionConfiguration.Executable
' 2. Connect to the IronPDF host with the executable configuration
IronPdf.Installation.ConnectToIronPdfHost(config)
' 3. Create a PDF renderer instance
Dim renderer As New ChromePdfRenderer()
' 4. Render HTML string as PDF document
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf("Hello world")
' 5. Save the PDF to disk
pdf.SaveAs("output.pdf")
' 6. Clean up, this is needed to work
pdf.Dispose()Imports IronPdf
' This code demonstrates how to use IronPdf with gRPC in a .NET Framework application.
' 1. Configure connection to use local IronPdfEngine executable
Dim config = IronPdf.GrpcLayer.IronPdfConnectionConfiguration.Executable
' 2. Connect to the IronPDF host with the executable configuration
IronPdf.Installation.ConnectToIronPdfHost(config)
' 3. Create a PDF renderer instance
Dim renderer As New ChromePdfRenderer()
' 4. Render HTML string as PDF document
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf("Hello world")
' 5. Save the PDF to disk
pdf.SaveAs("output.pdf")
' 6. Clean up, this is needed to work
pdf.Dispose()WithCustomChannel を使用した代替方法
別の方法としては、IronPdf.GrpcLayerメソッドを利用することも可能です。
WithCustomChannel は 2 つのパラメータを受け取ります。1 つは customChannel(カスタム gRPC チャネル)で、もう 1 つは metadata です。 metadata パラメータはオプションであり、デフォルトでは null に設定されています。
using IronPdf;
using IronPdf.GrpcLayer;
using Grpc.Core;
// 1. Create custom gRPC channel (.NET Framework style)
var channel = new Channel("123.456.7.8:80", ChannelCredentials.SecureSsl);
// 2. (Optional) Add metadata headers if needed
var metadata = new Metadata
{
{ "Authorization", "Bearer your_token_here" }
};
// 3. Configure IronPDF with custom channel
var config = IronPdfConnectionConfiguration.WithCustomChannel(channel, metadata);
IronPdf.Installation.ConnectToIronPdfHost(config);
// 4. Generate PDF
var renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("Hello world");
// 5. Save the PDF to disk
pdf.SaveAs("output.pdf");
// 6. Clean up , this is needed to work
pdf.Dispose();using IronPdf;
using IronPdf.GrpcLayer;
using Grpc.Core;
// 1. Create custom gRPC channel (.NET Framework style)
var channel = new Channel("123.456.7.8:80", ChannelCredentials.SecureSsl);
// 2. (Optional) Add metadata headers if needed
var metadata = new Metadata
{
{ "Authorization", "Bearer your_token_here" }
};
// 3. Configure IronPDF with custom channel
var config = IronPdfConnectionConfiguration.WithCustomChannel(channel, metadata);
IronPdf.Installation.ConnectToIronPdfHost(config);
// 4. Generate PDF
var renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("Hello world");
// 5. Save the PDF to disk
pdf.SaveAs("output.pdf");
// 6. Clean up , this is needed to work
pdf.Dispose();Imports IronPdf
Imports IronPdf.GrpcLayer
Imports Grpc.Core
' 1. Create custom gRPC channel (.NET Framework style)
Dim channel As New Channel("123.456.7.8:80", ChannelCredentials.SecureSsl)
' 2. (Optional) Add metadata headers if needed
Dim metadata As New Metadata From {
{"Authorization", "Bearer your_token_here"}
}
' 3. Configure IronPDF with custom channel
Dim config As IronPdfConnectionConfiguration = IronPdfConnectionConfiguration.WithCustomChannel(channel, metadata)
IronPdf.Installation.ConnectToIronPdfHost(config)
' 4. Generate PDF
Dim renderer As New ChromePdfRenderer()
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf("Hello world")
' 5. Save the PDF to disk
pdf.SaveAs("output.pdf")
' 6. Clean up, this is needed to work
pdf.Dispose()Imports IronPdf
Imports IronPdf.GrpcLayer
Imports Grpc.Core
' 1. Create custom gRPC channel (.NET Framework style)
Dim channel As New Channel("123.456.7.8:80", ChannelCredentials.SecureSsl)
' 2. (Optional) Add metadata headers if needed
Dim metadata As New Metadata From {
{"Authorization", "Bearer your_token_here"}
}
' 3. Configure IronPDF with custom channel
Dim config As IronPdfConnectionConfiguration = IronPdfConnectionConfiguration.WithCustomChannel(channel, metadata)
IronPdf.Installation.ConnectToIronPdfHost(config)
' 4. Generate PDF
Dim renderer As New ChromePdfRenderer()
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf("Hello world")
' 5. Save the PDF to disk
pdf.SaveAs("output.pdf")
' 6. Clean up, this is needed to work
pdf.Dispose()AWS ECS への IronPdfEngine のデプロイ
前提条件
- IronPdfEngineのDockerイメージを取得してください。 これは、上記の"Dockerコンテナ用IronPDFのセットアップ"に記載されています。
- ECSにアクセス可能なAWSアカウント。
セットアップ
- ECSクラスターを作成します。 このガイドに従って、コンソールを使用して Fargate および External 起動タイプ用のクラスターを作成してください。
- タスク定義を作成します。 コンソールを使用してタスク定義を作成するには、このガイドに従ってください。
推奨設定:
-
AWS Fargate
-
最低でも 1 vCPU と 2 GB の RAM を推奨します。 作業量によっては、10ページを超えるPDFを扱う場合や、リクエストの負荷が高い場合は、より上位のプランを選択してください。
-
ネットワークモード: awsvpc
-
ポートマッピング:
{ "containerPort": 33350, "hostPort": 33350, "protocol": "tcp", "appProtocol": "grpc" }JSON -
画像のURI:当社のIronPdfEngineのいずれかを指定してください。 例:"ironsoftwareofficial/IronPdfEngine:2024.1.20"(DockerHubより)
-
AWSの権限設定およびネットワーク設定については、ご自身で行ってください
-
Amazon CloudWatch の有効化をお勧めします。 (Enable logging)
-
アプリケーションコンテナを同じタスク定義内にデプロイする場合は、コンテナの起動順序を指定する必要があります。
- タスク定義を実行します。 タスク定義は、タスクまたはサービスとして実行できます。 コンソールを使用してサービスを作成する方法については、このガイドに従ってください。
推奨設定:
- 起動タイプ: AWS Fargate
- パブリックIP: テスト環境では有効、本番環境では無効。 セキュリティおよびAWSネットワークに関する翻訳は、ご自身で行ってください。
- どうぞお楽しみください! IronPdfEngine DockerがAWS上で稼働しています!
Azure Container Instances への IronPdfEngine のデプロイ
前提条件
- IronPdfEngineのDockerイメージを取得してください。 これは、上記の"Dockerコンテナ用IronPDFのセットアップ"に記載されています。
- Azure アカウント
セットアップ
- Azure コンテナを作成します。 Azure ポータルを使用して Azure にコンテナ インスタンスをデプロイする方法については、このクイックスタート ガイドに従ってください。
推奨設定:
- 画像出典: Other registry
- 画像: ironsoftwareofficial/IronPdfEngine:2024.1.20 (Docker Hubより)
- OSの種類: Linux
- システム要件: 1 vCPU および 2 GiB 以上のメモリ
- ポート: TCP ポート 33350
- どうぞお楽しみください! IronPdfEngine Docker が Azure Container Instances 上で起動し、稼働しています!
AWS ECR パブリックギャラリーで IronPdfEngine を入手する
前提条件
- Dockerがインストールされている必要があります。
セットアップ
- 以下のページにアクセスしてください https://gallery.ecr.aws/v1m9w8y1/ironpdfengine
- v1m9w8y1/IronPdfEngine イメージを取得する
docker pull https://gallery.ecr.aws/v1m9w8y1/ironpdfengine
または、特定のバージョンを取得する(推奨)
docker pull https://gallery.ecr.aws/v1m9w8y1/ironpdfengine:2023.12.6
- IronPdfEngine コンテナを実行します。
このコマンドはコンテナを作成し、ポート 33350 でバックグラウンドで実行します
docker run -d -p 33350:33350 ironsoftwareofficial/ironpdfengine
"IronPdfEngineを使用するためのコードの更新"セクションに進み、IronPdfEngineを利用するためのIronPDFクライアントの設定方法を確認してください。
MarketplaceからIronPdfEngineを入手する
すぐに使い始められるよう、AzureおよびAWSのマーケットプレイスにIronPdfEngineを用意しました。
Azure Marketplace
セットアップ
- Azure MarketplaceのIronPDF Dockerコンテナにアクセスしてください。 "今すぐ入手"および"続行"をクリックしてください。
- "基本設定"、"クラスタの詳細"、"アプリケーションの詳細"を入力して、Kubernetes サービスを作成します。
- デプロイが完了したら、左側のサイドバーに移動し、"Kubernetes リソース">"コマンドの実行"を選択します。 次のコマンドを実行してください:
kubectl get services

EXTERNAL-IP および PORT(S) の情報を使用すれば、IronPdfEngine の接続を適切に設定できます。
using IronPdf;
using IronPdf.GrpcLayer;
IronPdf.License.LicenseKey = "IRONPDF-MYLICENSE-KEY-1EF01";
IronPdfConnectionConfiguration configuration = new IronPdfConnectionConfiguration();
configuration.ConnectionType = IronPdfConnectionType.RemoteServer;
configuration.Host = "http://48.216.143.233";
configuration.Port = 80;
IronPdf.Installation.ConnectToIronPdfHost(configuration);
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>testing</h1>");
pdf.SaveAs("output.pdf");using IronPdf;
using IronPdf.GrpcLayer;
IronPdf.License.LicenseKey = "IRONPDF-MYLICENSE-KEY-1EF01";
IronPdfConnectionConfiguration configuration = new IronPdfConnectionConfiguration();
configuration.ConnectionType = IronPdfConnectionType.RemoteServer;
configuration.Host = "http://48.216.143.233";
configuration.Port = 80;
IronPdf.Installation.ConnectToIronPdfHost(configuration);
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>testing</h1>");
pdf.SaveAs("output.pdf");Imports IronPdf
Imports IronPdf.GrpcLayer
IronPdf.License.LicenseKey = "IRONPDF-MYLICENSE-KEY-1EF01"
Dim configuration As New IronPdfConnectionConfiguration()
configuration.ConnectionType = IronPdfConnectionType.RemoteServer
configuration.Host = "http://48.216.143.233"
configuration.Port = 80
IronPdf.Installation.ConnectToIronPdfHost(configuration)
Dim renderer As New ChromePdfRenderer()
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>testing</h1>")
pdf.SaveAs("output.pdf")Imports IronPdf
Imports IronPdf.GrpcLayer
IronPdf.License.LicenseKey = "IRONPDF-MYLICENSE-KEY-1EF01"
Dim configuration As New IronPdfConnectionConfiguration()
configuration.ConnectionType = IronPdfConnectionType.RemoteServer
configuration.Host = "http://48.216.143.233"
configuration.Port = 80
IronPdf.Installation.ConnectToIronPdfHost(configuration)
Dim renderer As New ChromePdfRenderer()
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>testing</h1>")
pdf.SaveAs("output.pdf")AWS Marketplace
前提条件
- Dockerがインストールされている必要があります。
- AWS CLIがインストールされ、ログイン済みである必要があります。
セットアップ
-
AWSマーケットプレイスのIronPdfEngineにアクセスしてください。 "購読を続ける"をクリックしてください。
-
利用規約に同意する。

- "設定"に進みます。

- IronPdfEngineのイメージを取得します。 この手順では、IronPdfEngineのイメージを取得するためのコマンドを紹介します。

例:
aws ecr get-login-password \
--region us-east-1 | docker login \
--username AWS \
--password-stdin 000000000000.dkr.ecr.us-east-1.amazonaws.com
CONTAINER_IMAGES="000000000000.dkr.ecr.us-east-1.amazonaws.com/iron-software/ironpdfengine:2024.1.15"
for i in $(echo $CONTAINER_IMAGES | sed "s/,/ /g"); do docker pull $i; done
- IronPdfEngine コンテナを実行します。 このコマンドはコンテナを作成し、ポート 33350 を使用してバックグラウンドで実行します。
docker run -d -p 33350:33350 000000000000.dkr.ecr.us-east-1.amazonaws.com/iron-software/ironpdfengine:2024.1.15
IronPdfEngineのヘルスチェック
本番環境における信頼性と可用性を確保するには、Dockerコンテナの状態を確認することが不可欠です。 IronPdfEngine Docker コンテナの状態を確認できる機能により、開発者はサービスが停止した場合に再起動したり、需要が増加した際にリソースをスケールアップしたりできるほか、アプリケーションの継続的な監視も可能です。
IronPdfEngineの稼働状況を確認するには、同じIronPdfEngineポート(デフォルトでは33350)にgRPCリクエストを送信し、応答が得られるかどうかを確認します。
gRPC によるヘルスチェック
IronPdfEngineは、標準的なgRPCヘルスチェックパターンに準拠し、以下のプロトコル構造を採用しています。
message HealthCheckRequest {
string service = 1; // Name of the service to check (e.g., "IronPdfEngine")
}
IronPdfEngineのチェックを行っているため、サービス名をIronPdfEngineに置き換えます。
以下は、Postman を使用して JavaScript から、デフォルトのポート番号 33350 を持つローカルの IronPdfEngine サービスに gRPC リクエストを送信する例です。

応答からわかるように、ステータス応答は SERVING であり、サービスが稼働中であることを示しています。 コンテナの状態が正常でない場合、ステータス応答は NOT_SERVING となります。
Kubernetes セットアップのヘルスチェック
Kubernetes の設定において、サービスが正常かどうかを確認するには、以下を使用できます。
livenessProbe:
exec:
command:
- /bin/grpc_health_probe
- -addr=:33350
- -rpc-timeout=5s
よくある質問
Dockerを使用してC#でHTMLをPDFに変換するにはどうすればよいですか?
IronPDF の Docker セットアップを使用して、C# で HTML を PDF に変換できます。 Docker コンテナに IronPDFEngine をデプロイし、RenderHtmlAsPdf などのメソッドを使用して、この変換を実現します。
DockerでIronPDFEngineを使用する利点は何ですか?
DockerでIronPDFEngineを使用すると、事前インストール済みで信頼性のある環境が提供され、依存関係の問題が軽減され、ChromeやPdfiumバイナリなどの必要なコンポーネントがすべて利用可能であることを保証します。
Docker Composeを使用してIronPDFEngineをセットアップするにはどうすればよいですか?
docker-compose.ymlファイルを作成し、サービスとネットワークを定義します。depends_onディレクティブを使用して、IronPDFEngineがアプリケーションよりも先に起動することを確認します。
AWS ECSにIronPDFEngineをデプロイするために必要な手順は何ですか?
AWS ECS にデプロイするには、ECS クラスターを作成し、タスク定義を定義し、リソース割り当てに AWS Fargate を使用します。その後、タスクまたはサービスを実行して IronPDFEngine を起動します。
AWS ECR Public GalleryからIronPDFEngineをプルするにはどうすればよいですか?
AWS ECR Public Gallery にアクセスし、IronPDFEngine イメージを見つけ、提供されているコマンドに従ってコンテナをプルして実行します。
Azure MarketplaceからIronPDFEngineを利用することは可能ですか?
はい、IronPDFEngineはAzure Marketplaceで利用可能です。マーケットプレイスページのセットアップ手順に従って、Dockerコンテナをデプロイできます。
IronPDFEngineを使用する際に注意すべき制限はありますか?
IronPdfEngine Dockerコンテナ自体は水平スケーリングをサポートしていません。これは単一インスタンスのバックエンドサービスとして設計されているためです。しかし、IronPDFライブラリ(IronPdfEngineを使用するか否かに関わらず)を使用するアプリケーションは、複数のアプリケーションインスタンスをデプロイすることによって水平スケーリングが可能です。この違いを念頭に置いてデプロイメントを計画してください。
Dockerを使用して効率的にPDF生成と操作タスクを処理するにはどうすればよいですか?
IronPDFEngineをDockerコンテナにデプロイして、PDF生成と操作タスクを効率的に管理し、Dockerの機能を活用して依存関係を処理し、一貫した環境を確保します。
Azure Container InstancesにIronPDFEngineをデプロイするための要件は何ですか?
Azure Container Instances にデプロイするには、Azure アカウントを持っていることを確認し、デプロイ用に IronPDFEngine Docker イメージをプルします。
Are there specific logging configurations available for IronPdfEngine?
Yes, IronPdfEngine supports various logging configurations, including console, file, and custom modes. This flexibility helps in monitoring and debugging, allowing developers to choose the best method for their needs.
Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。

