Class DocumentImageExporter
Public entry points for rendering document pages as raster images.
Inherited Members
Namespace: DRIT.Document.Export.Image
Assembly: DRIT.Document.dll
Syntax
public static class DocumentImageExporter
Methods
RenderToImages(Document, ImageSaveOptions)
Renders the selected document pages as raster images.
Declaration
public static IReadOnlyList<Bitmap> RenderToImages(this Document document, ImageSaveOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Document | document | The document to render. |
| ImageSaveOptions | options | Image rendering options, or null for defaults. |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<Bitmap> | The rendered page bitmaps. The caller owns and must dispose them. |
SaveAsImage(Document, Stream, ImageSaveOptions)
Renders exactly one document page to an image stream.
Declaration
public static void SaveAsImage(this Document document, Stream stream, ImageSaveOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Document | document | The document to render. |
| Stream | stream | The destination stream, which remains open. |
| ImageSaveOptions | options | Image rendering options, or null for defaults. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | More than one page was selected. |
SaveAsImage(Document, string, ImageSaveOptions)
Renders document pages and saves each one to an image file.
When multiple pages are selected, {page} can be used in the
path pattern; otherwise a _pageN suffix is inserted.
Declaration
public static void SaveAsImage(this Document document, string pathPattern, ImageSaveOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Document | document | The document to render. |
| string | pathPattern | The output path or page-aware path pattern. |
| ImageSaveOptions | options | Image rendering options, or null for defaults. |