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
inputStreamThe readable stream containing the source document.
imageOptionsImageRenderOptionsRaster options: DPI, format, quality and the per-page sink.
optionsConvertOptionsThe 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. Setting neither renders only the first selected page and reports a diagnostic, rather than silently discarding the rest.
The pipeline up to layout is identical to Convert(Stream, Stream, ConvertOptions?) — same reader, same resolver, same layout engine — so a page's image and its PDF are two encodings of one layout, not two independent renderings.
Exceptions
- ArgumentNullException
inputorimageOptionsis null.- ArgumentException
inputis not readable.
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
documentWordDocumentThe document to convert.
imageOptionsImageRenderOptionsRaster options: DPI, format, quality and the per-page sink.
optionsConvertOptionsThe conversion options, or null for defaults.
Returns
- ConversionResult
A summary of the conversion.
Exceptions
- ArgumentNullException
documentorimageOptionsis null.