Rasterize to Image using MemoryStream

How do I convert PDF pages to images using memorystream, without touching the file system

PDFs can be loading from MemoryStream:
https://ironpdf.com/docs/questions/pdf-memory-stream/#sample-load-pdf-from-memory
https://ironpdf.com/object-reference/api/IronPdf.PdfDocument.html#IronPdf_PdfDocument__ctor_System_IO_Stream_System_String_System_String_System_Boolean_

To export PDF pages as images, first use PdfDocument.ToBitMap() to get an array of .NET bitmaps.

using IronPdf;
using System.Drawing; 

//Example rendering PDF documents to Images or Thumbnails
using var Pdf = PdfDocument.FromFile("Example.pdf");

// or make one using Chrome Renderer
System.Drawing.Bitmap[] pageImages = Pdf.ToBitmap();

foreach (var bitmap in pageImages)
{
using(MemoryStream memoryStream = new MemoryStream();)
{
// save to JPEG
bitmap.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Jpeg);

// use memoryStream

}
bmp.Dispose();
}