Table of Contents

Method ConvertToImages

Namespace
DocWright
Assembly
DocWright.dll

ConvertToImages(Stream, ImageRenderOptions, ConvertOptions?)

Converts a supported document stream to raster images, one per page.

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

Parameters

input Stream

The readable stream containing the source document.

imageOptions ImageRenderOptions

Raster options: DPI, format, quality and the per-page sink.

options ConvertOptions

The conversion options, or null for defaults.

Returns

ConversionResult

A summary of the conversion.

Remarks

Pages are delivered through PageStreamFactory or PageEncoded, because a raster format holds one page and a document has many. This method has no output stream of its own, so setting neither is an ArgumentException rather than a conversion whose pages go nowhere.

The pipeline up to layout is identical to Convert(Stream, Stream, ConvertOptions?) — same reader, same resolver, same layout engine, and therefore the same diagnostics, limits and StrictMode refusals from those stages — so a page's image and its PDF are two encodings of one layout, not two independent renderings.

Of the options layout reads, TaggedPdf is the one that does not carry over. Logical structure belongs to a PDF and a raster has nowhere to hold it, so an image conversion is laid out without it and its bytes do not depend on that setting.

Exceptions

ArgumentNullException

input or imageOptions is null.

ArgumentException

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

ConvertToImages(WordDocument, ImageRenderOptions, ConvertOptions?)

Converts a mutable DOM document directly to raster images, one per page.

public ConversionResult ConvertToImages(WordDocument document, ImageRenderOptions imageOptions, ConvertOptions? options = null)

Parameters

document WordDocument

The document to convert.

imageOptions ImageRenderOptions

Raster options: DPI, format, quality and the per-page sink.

options ConvertOptions

The conversion options, or null for defaults.

Returns

ConversionResult

A summary of the conversion.

Exceptions

ArgumentNullException

document or imageOptions is null.

ArgumentException

imageOptions sets neither page sink.