ImageEnumerable Class

Provides access to images embedded in a PDF document.

public class ImageEnumerable : IEnumerable<Image>, 
	IEnumerable, IAsyncEnumerable<Image>
Namespace
PdfToSvg
Package
PdfToSvg.NET (since v1.3.0)
Inheritance
System.Object PdfToSvg.ImageEnumerable

Example

The following example exports images from all pages in the PDF document to image files.

using (var document = PdfDocument.Open("input.pdf"))
{
    var imageNo = 1;

    foreach (var image in document.Images)
    {
        var content = image.GetContent();
        var fileName = $"image{imageNo++}{image.Extension}";
        File.WriteAllBytes(fileName, content);
    }
}

Methods

GetAsyncEnumeratorGets an enumerator that iterates over embedded images asynchronously.
GetEnumeratorGets an enumerator that iterates over embedded images.
ToListAsyncReturns embedded images as a list asynchronously.

See Also

PdfToSvg Namespace