Table of Contents

Method ConvertPdfToImages

Namespace
DocWright
Assembly
DocWright.dll

ConvertPdfToImages(Stream, ImageRenderOptions, ConvertOptions?)

Rasterizes the pages of an existing PDF to images, one per page.

public ConversionResult ConvertPdfToImages(Stream input, ImageRenderOptions imageOptions, ConvertOptions? options = null)

Parameters

input Stream

The readable stream containing the PDF.

imageOptions ImageRenderOptions

Raster options: resolution, size, format, quality and the per-page sink. The same bag ConvertToImages(Stream, ImageRenderOptions, ConvertOptions?) takes.

options ConvertOptions

The conversion options, or null for defaults.

Returns

ConversionResult

A summary of the conversion.

Remarks

This is the only place a caller meets both raster vocabularies, and it is where they are reconciled. ImageRenderOptions is the one bag the facade publishes; the PDF reader's own options are an implementation detail behind this method, which is why PdfImageFormat can stay a separate enum without a caller ever having to know that. Size, fit, scale and the clamps mean exactly what they mean on the document path.

Concurrency (I11): a fresh reader is constructed per call and disposed before returning, so this method is safe to call concurrently — but a PdfDocument obtained directly from PdfDocument.Open is not, and must not be shared between threads. The same rule the imaging renderer records.

Page selection comes from Pages, and a password from Password, so an encrypted PDF is opened the same way an encrypted Word document is.

Exceptions

ArgumentNullException

input or imageOptions is null.

ArgumentException

input is not readable, or imageOptions sets neither page sink.

ArgumentOutOfRangeException

The page selection is outside the document.