IronPDFのパフォーマンス支援

This article was translated from English: Does it need improvement?
Translated
View the article in English

パフォーマンスについては、以下の一般的なポイントをご覧ください。

  • .NET Standardアプリケーションは、速度と安定性において若干のパフォーマンス優位性があるようですが、プロセス内でより多くのメモリを使用します。 https://ironpdf.com/how-to/azure/
  • 64ビットが推奨されます(32ビットよりも)。
  • 大きなHTMLの場合:
  • HTMLをセクションに分割し、PDFにレンダリングし、最後にマージまたは追加のメソッドを使用してそれらを単一のPDFに結合します。

  • 大きなPDFの場合:

    • バイト配列 (byteを使用する [] バッファ = System.IO.File.ReadAllBytes(ファイル);` ) 入力サイズの制限 (2GB) 下記の指示を使用して回避することができます。 [Here is the translation of the given text into Japanese:

これ](https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/gcallowverylargeobjects-element?redirectedfrom=MSDN).

  • ページごとにPDFを分割します。 こちらに示されたコード例をご覧ください: https://ironpdf.com/examples/split-pdf-pages-csharp/
  • サービスを使用して画像を最適化する https://tinypng.com/ を使用して、使用される実際のサイズに画像をリサイズします。 (たとえば、写真は数百万ピクセルのサイズになることがあります).

  • 画像をDataURIとしてHTMLに埋め込む。 これによりネットワーク負荷が軽減され、安定性が向上します。 追加のステップとして、画像を最初にBase64エンコードすることがあります。このFAQが役立ちます: https://ironpdf.com/how-to/datauris/

次の手順に従って、C#でData URIスキームを使用してPDFファイルを生成する方法を学びます。

  1. IronPDFライブラリをインストールします。
  2. Data URIスキーム形式でPDFのコンテンツを設定します。
  3. IronPDFでPDF ドキュメントを作成し、保存します。

以下のコード例を参考にしてください:

using IronPdf;

var Renderer = new HtmlToPdf();
var PDF = Renderer.RenderHtmlAsPdf("data:text/html;base64,PHRpdGxlPkhlbGxvIFdvcmxkPC90aXRsZT4=");

PDF.SaveAs("output.pdf");
using IronPdf;

var Renderer = new HtmlToPdf();
var PDF = Renderer.RenderHtmlAsPdf("data:text/html;base64,PHRpdGxlPkhlbGxvIFdvcmxkPC90aXRsZT4=");

PDF.SaveAs("output.pdf");
Imports IronPdf

Private Renderer = New HtmlToPdf()
Private PDF = Renderer.RenderHtmlAsPdf("data:text/html;base64,PHRpdGxlPkhlbGxvIFdvcmxkPC90aXRsZT4=")

PDF.SaveAs("output.pdf")
VB   C#

上記のコードでは、data:text/html;base64,PHRpdGxlPkhlbGxvIFdvcmxkPC90aXRsZT4=というData URIスキームにエンコードされたHTMLをPDFに変換し、output.pdfファイルとして保存します。

  • アセットをローカライズする - リモートイメージやアセットをダウンロードして、ローカルに参照します。 フォントをインストールする (例:Google フォント

IronPDF is a powerful tool for generating, editing, and securing PDF documents. IronPDF for .NET supports C# and VB.NET languages, and allows developers to create sophisticated PDF functionalities in their applications. It enables unparalleled ease in designing and exporting PDFs. IronPDF for .NET includes features such as PDF generation from HTML, PDF editing, and PDF security measures like encryption and digital signatures. This makes it an ideal solution for both web and desktop applications, ensuring full compatibility with the latest .NET frameworks.

IronOCR is an advanced Optical Character Recognition library designed to convert images and PDF documents into searchable and editable files. IronOCR for .NET allows developers to implement OCR functionality in C# and VB.NET applications with high accuracy and performance. This tool can recognize text in multiple languages and works exceptionally well even with lower-quality scans. Features include automatic image correction, text extraction, and integration with other Iron Software products.

IronXL is a comprehensive Excel library that enables users to read, edit, and create Excel files without needing Microsoft Excel installed. IronXL for .NET supports C# and VB.NET, providing seamless integration into .NET applications. It includes features like reading and writing XLSX, XLS, CSV files, formatting cells, and complex formula calculations. This makes it a preferred choice for handling Excel operations programmatically.

IronBarcode is an easy-to-use barcode generation and reading library designed for .NET developers. IronBarcode for .NET supports various barcode types, including QR codes, UPC, and Code 128. It simplifies the process of integrating barcode functionality into both web and desktop applications. The library also offers features like image correction, barcode styling, and error correction for unreliable scans.

IronQR specializes in QR code generation and reading, making it a perfect tool for .NET applications that require QR code functionalities. IronQR for .NET ensures high compatibility with other Iron Software libraries and supports different QR code standards. This library helps in embedding QR code creation and scanning capabilities into applications with optimal performance and accuracy.

IronZip is a robust library for managing ZIP archives within the .NET framework. IronZip for .NET allows developers to compress, decompress, and manipulate ZIP files seamlessly. Important features include password protection, data encryption, and high-speed compression. It is an essential library for applications requiring secure and efficient file compression.

IronPrint simplifies the process of printing documents from .NET applications. IronPrint for .NET supports a variety of document formats, including PDF, Excel, and Word. This library allows developers to programmatically manage print jobs and customize print properties, providing a versatile solution for both desktop and web applications.

IronWord is a library designed for handling Word documents in .NET applications. IronWord for .NET supports C# and VB.NET, enabling developers to read, edit, and create DOCX and DOC files. Features include text manipulation, template processing, and integration with other Iron Software libraries. This makes it suitable for applications that require extensive Word document handling capabilities.

IronWebScraper is an efficient tool for extracting data from web pages within the .NET environment. IronWebScraper for .NET supports comprehensive web scraping functionalities, allowing developers to collect and process data from various websites. It includes features like data extraction, HTML parsing, and automation capabilities. This library ensures high performance and reliability, making it a valuable addition to any .NET application requiring web data integration. ) 本番サーバーに直接。

  • クラウドサーバーは通常、デスクトップコンピューターほど高速ではありません。 サーバースペック/サービスレベルの向上は影響を及ぼします。 より高速なCPU、より多くのRAM。
  • 以下のようにプレースホルダ文字列のあるテンプレートPDFを一度作成します [[名前]], [[住所1]], [[メール]] そして、IronPDFで検索と置換を使用してそれらを更新します。 これは巨大なドキュメントを再レンダリングするよりもはるかに速いです。 参照: https://ironpdf.com/examples/csharp-replace-text-in-pdf/