IronPDF トラブルシューティング MemoryStreamを使用して画像にラスター化 Rasterizing PDFs to Images with MemoryStream Curtis Chau 更新日:6月 1, 2025 Download IronPDF NuGet Download テキストの検索と置換 テキストと画像のスタンプ Start Free Trial Copy for LLMs Copy for LLMs Copy page as Markdown for LLMs Open in ChatGPT Ask ChatGPT about this page Open in Gemini Ask Gemini about this page Open in Grok Ask Grok about this page Open in Perplexity Ask Perplexity about this page Share Share on Facebook Share on X (Twitter) Share on LinkedIn Copy URL Email article This article was translated from English: Does it need improvement? Translated View the article in English ファイルシステムに触れずにMemoryStreamを使ってPDFページを画像に変換するにはどうすればよいですか? IronPDFはMemoryStreamからPDFドキュメントを読み込むことができます。 (How-Tos| APIリファレンス) PdfDocument.ToBitmap()メソッドを使ってPDFページを画像としてエクスポートします。 これは、さらなる処理に使用できるIronSoftware.Drawing.AnyBitmapオブジェクトの配列を返します。 using IronPdf; using System.IO; // Example rendering PDF documents to Images or Thumbnails using var pdf = PdfDocument.FromFile("Example.pdf"); // Convert each page of the PDF document to a bitmap image IronSoftware.Drawing.AnyBitmap[] pageImages = pdf.ToBitmap(); foreach (var bitmap in pageImages) { // Use MemoryStream to handle the image data in memory using (MemoryStream memoryStream = new MemoryStream()) { // Export the image to MemoryStream as a PNG format bitmap.ExportStream(memoryStream, IronSoftware.Drawing.AnyBitmap.ImageFormat.Png); // MemoryStream can now be used for further processing without touching the file system // Example: Send it over a network, save to a database, etc. } // Dispose of the bitmap once processing is complete to free resources bitmap.Dispose(); } using IronPdf; using System.IO; // Example rendering PDF documents to Images or Thumbnails using var pdf = PdfDocument.FromFile("Example.pdf"); // Convert each page of the PDF document to a bitmap image IronSoftware.Drawing.AnyBitmap[] pageImages = pdf.ToBitmap(); foreach (var bitmap in pageImages) { // Use MemoryStream to handle the image data in memory using (MemoryStream memoryStream = new MemoryStream()) { // Export the image to MemoryStream as a PNG format bitmap.ExportStream(memoryStream, IronSoftware.Drawing.AnyBitmap.ImageFormat.Png); // MemoryStream can now be used for further processing without touching the file system // Example: Send it over a network, save to a database, etc. } // Dispose of the bitmap once processing is complete to free resources bitmap.Dispose(); } Imports IronPdf Imports System.IO ' Example rendering PDF documents to Images or Thumbnails Private pdf = PdfDocument.FromFile("Example.pdf") ' Convert each page of the PDF document to a bitmap image Private pageImages() As IronSoftware.Drawing.AnyBitmap = pdf.ToBitmap() For Each bitmap In pageImages ' Use MemoryStream to handle the image data in memory Using memoryStream As New MemoryStream() ' Export the image to MemoryStream as a PNG format bitmap.ExportStream(memoryStream, IronSoftware.Drawing.AnyBitmap.ImageFormat.Png) ' MemoryStream can now be used for further processing without touching the file system ' Example: Send it over a network, save to a database, etc. End Using ' Dispose of the bitmap once processing is complete to free resources bitmap.Dispose() Next bitmap $vbLabelText $csharpLabel ビットマップをMemoryStreamに保存する詳細については役立つStack Overflowの記事があります。 Curtis Chau 今すぐエンジニアリングチームとチャット テクニカルライター Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。開発以外にも、CurtisはIoT(Internet of Things)への強い関心を持ち、ハードウェアとソフトウェアの統合方法を模索しています。余暇には、ゲームをしたりDiscordボットを作成したりして、技術に対する愛情と創造性を組み合わせています。 準備はいいですか? Nuget ダウンロード 16,154,058 | バージョン: 2025.11 ただ今リリースされました 試用ライセンスキーがメールで送信されました。 総ダウンロード数: 16,154,058 ライセンスを見る