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
inputStreamThe readable stream containing the PDF.
imageOptionsImageRenderOptionsRaster options: resolution, size, format, quality and the per-page sink. The same bag ConvertToImages(Stream, ImageRenderOptions, ConvertOptions?) takes.
optionsConvertOptionsThe 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
inputorimageOptionsis null.- ArgumentException
inputis not readable, orimageOptionssets neither page sink.- ArgumentOutOfRangeException
The page selection is outside the document.