IronPDF トラブルシューティング AWS Lambda / Amazon Linux 2 AWS Lambda IronPDF on Amazon Linux 2</a カーティス・チャウ 更新日:2025年8月31日 IronPDF をダウンロード NuGet ダウンロード DLL ダウンロード Windows 版 無料トライアル LLM向けのコピー LLM向けのコピー LLM 用の Markdown としてページをコピーする ChatGPTで開く このページについてChatGPTに質問する ジェミニで開く このページについてGeminiに問い合わせる Grokで開く このページについてGrokに質問する 困惑の中で開く このページについてPerplexityに問い合わせる 共有する Facebook で共有 Xでシェア(Twitter) LinkedIn で共有 URLをコピー 記事をメールで送る This article was translated from English: Does it need improvement? Translated View the article in English AWS Lambda / Amazon Linux 2 (IronPdf.Linux を使用して管理者/ルートとしてインストール) この情報は、当社のウェブサイトにも表示されます - AWS Lambda IronPDFガイド AWS インストラクション AWS .NET 5 Lambda コンテナイメージをサポート を参照 次の Dockerfile を作成して使用します: # Use the .NET 5 AWS Lambda runtime as the base image FROM public.ecr.aws/lambda/dotnet:5.0 WORKDIR /var/task # Install the necessary dependencies for IronPDF RUN yum install -y pango.x86_64 \ libXcomposite.x86_64 \ libXcursor.x86_64 \ libXdamage.x86_64 \ libXext.x86_64 \ libXi.x86_64 \ libXtst.x86_64 \ cups-libs.x86_64 \ libXScrnSaver.x86_64 \ libXrandr.x86_64 \ GConf2.x86_64 \ alsa-lib.x86_64 \ atk.x86_64 \ gtk3.x86_64 \ ipa-gothic-fonts \ xorg-x11-fonts-100dpi \ xorg-x11-fonts-75dpi \ xorg-x11-utils \ xorg-x11-fonts-cyrillic \ xorg-x11-fonts-Type1 \ xorg-x11-fonts-misc \ glibc-devel.x86_64 \ at-spi2-atk.x86_64 \ mesa-libgbm.x86_64 # This COPY command copies the .NET Lambda project's build artifacts from the host machine into the image. COPY "bin/Release/lambda-publish" . ソリューションに IronPdf.Linux パッケージを追加します。 _FunctionHandler コードを変更します - この例では、Web ページ ( IronPDF ) から PDF を作成し、/tmp に保存します。 この PDF を表示するには、S3 などの他のサービスにアップロードする必要があります。(公式 AWS 例はこちら - AWS S3 の基本) // Define the function handler for AWS Lambda public Casing FunctionHandler(string input, ILambdaContext context) { try { // Start logging the function process with input details context.Logger.LogLine($"START FunctionHandler RequestId: {context.AwsRequestId} Input: {input}"); var awsTmpPath = @"/tmp/"; // AWS temporary storage path // Optional: Enable debugging for IronPdf // IronPdf.Logging.Logger.EnableDebugging = true; // IronPdf.Logging.Logger.LogFilePath = awsTmpPath; // IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All; // Set your license key for IronPDF IronPdf.License.LicenseKey = "YOUR_LICENSE_KEY"; // Configuration for IronPDF rendering IronPdf.Installation.ChromeGpuMode = IronPdf.Engines.Chrome.ChromeGpuModes.Disabled; IronPdf.Installation.DefaultRenderingEngine = IronPdf.Rendering.PdfRenderingEngine.Chrome; Environment.SetEnvironmentVariable("TEMP", awsTmpPath, EnvironmentVariableTarget.Process); Environment.SetEnvironmentVariable("TMP", awsTmpPath, EnvironmentVariableTarget.Process); IronPdf.Installation.TempFolderPath = awsTmpPath; IronPdf.Installation.CustomDeploymentDirectory = awsTmpPath; IronPdf.Installation.LinuxAndDockerDependenciesAutoConfig = true; context.Logger.LogLine($"Creating IronPdf.ChromePdfRenderer"); // Create instance of ChromePdfRenderer and render PDF from URL var renderer = new IronPdf.ChromePdfRenderer(); context.Logger.LogLine($"Rendering PDF"); using var pdfDoc = renderer.RenderUrlAsPdf("https://ironpdf.com/"); var guid = Guid.NewGuid(); var fileName = $"/tmp/{input}_{guid}.pdf"; // Name for the PDF file // Save the rendered PDF document context.Logger.LogLine($"Saving PDF name : {fileName}"); pdfDoc.SaveAs(fileName); // Here you can upload the saved PDF file to anywhere such as AWS S3. context.Logger.LogLine($"COMPLETE!"); } catch (Exception e) { // Log errors if any occur context.Logger.LogLine($"[ERROR] FunctionHandler : {e.Message}"); } // Return a new instance of Casing with lower and upper case input strings return new Casing(input?.ToLower(), input?.ToUpper()); } // Casing record to hold lower and upper case strings public record Casing(string Lower, string Upper); // Define the function handler for AWS Lambda public Casing FunctionHandler(string input, ILambdaContext context) { try { // Start logging the function process with input details context.Logger.LogLine($"START FunctionHandler RequestId: {context.AwsRequestId} Input: {input}"); var awsTmpPath = @"/tmp/"; // AWS temporary storage path // Optional: Enable debugging for IronPdf // IronPdf.Logging.Logger.EnableDebugging = true; // IronPdf.Logging.Logger.LogFilePath = awsTmpPath; // IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All; // Set your license key for IronPDF IronPdf.License.LicenseKey = "YOUR_LICENSE_KEY"; // Configuration for IronPDF rendering IronPdf.Installation.ChromeGpuMode = IronPdf.Engines.Chrome.ChromeGpuModes.Disabled; IronPdf.Installation.DefaultRenderingEngine = IronPdf.Rendering.PdfRenderingEngine.Chrome; Environment.SetEnvironmentVariable("TEMP", awsTmpPath, EnvironmentVariableTarget.Process); Environment.SetEnvironmentVariable("TMP", awsTmpPath, EnvironmentVariableTarget.Process); IronPdf.Installation.TempFolderPath = awsTmpPath; IronPdf.Installation.CustomDeploymentDirectory = awsTmpPath; IronPdf.Installation.LinuxAndDockerDependenciesAutoConfig = true; context.Logger.LogLine($"Creating IronPdf.ChromePdfRenderer"); // Create instance of ChromePdfRenderer and render PDF from URL var renderer = new IronPdf.ChromePdfRenderer(); context.Logger.LogLine($"Rendering PDF"); using var pdfDoc = renderer.RenderUrlAsPdf("https://ironpdf.com/"); var guid = Guid.NewGuid(); var fileName = $"/tmp/{input}_{guid}.pdf"; // Name for the PDF file // Save the rendered PDF document context.Logger.LogLine($"Saving PDF name : {fileName}"); pdfDoc.SaveAs(fileName); // Here you can upload the saved PDF file to anywhere such as AWS S3. context.Logger.LogLine($"COMPLETE!"); } catch (Exception e) { // Log errors if any occur context.Logger.LogLine($"[ERROR] FunctionHandler : {e.Message}"); } // Return a new instance of Casing with lower and upper case input strings return new Casing(input?.ToLower(), input?.ToUpper()); } // Casing record to hold lower and upper case strings public record Casing(string Lower, string Upper); $vbLabelText $csharpLabel メモリとタイムアウトを増やします - IronPDF は Lambda のデフォルト値よりも多くの時間とメモリを必要とします。 これは aws-lambda-tools-defaults.json で設定できます。 これらの値を機能のニーズに合わせて調整してください。 この例では、512 (MB) と 330 (秒) に設定しました: "function-memory-size": 512, "function-timeout": 330, この設定は、Lambda コンソールを使用しても更新できます - AWS Lambda メモリ設定。 ドキュメントの最終部分を追って、Lambda 関数を公開して試してください AWS .NET 5 Lambda コンテナイメージをサポート Lambda 関数は Lambda コンソールを使用して呼び出すこともできます、AWS Lambda コンソール または AWS ツールキット for Visual Studio を使用して Visual Studio 経由で呼び出すこともできます。 "GPU プロセスが使用できません"というメッセージを受け取った場合は、インストールが管理者権限で実行されなかった可能性があります。 ソフトウェアを再度管理者/ルート権限で実行してみてください。 あるいは、以下を Dockerfile に追加してください: RUN chmod 755 "runtimes/linux-x64/native/IronCefSubprocess" カーティス・チャウ 今すぐエンジニアリングチームとチャット テクニカルライター Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。開発以外にも、CurtisはIoT(Internet of Things)への強い関心を持ち、ハードウェアとソフトウェアの統合方法を模索しています。余暇には、ゲームをしたりDiscordボットを作成したりして、技術に対する愛情と創造性を組み合わせています。 準備はできましたか? Nuget ダウンロード 17,803,474 | バージョン: 2026.3 リリース 無料トライアル NuGet 無料版 総ダウンロード数: 17,803,474 ライセンスを見る まだスクロールしていますか? すぐに証拠が欲しいですか? PM > Install-Package IronPdf サンプルを実行するHTML が PDF に変換されるのを確認します。 NuGet 無料版 総ダウンロード数: 17,803,474 ライセンスを見る