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. 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
inputorimageOptionsis null.- ArgumentException
inputis not readable, orimageOptionssets 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
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.- ArgumentException
imageOptionssets neither page sink.