Class DocumentRenderingExtensions
Extension methods on Document that enable raster-image export.
Inherited Members
Namespace: DRIT.Pdf.Rendering
Assembly: DRIT.Pdf.dll
Syntax
public static class DocumentRenderingExtensions
Remarks
Add a reference to DRIT.Pdf.Rendering to bring these methods into scope.
Methods
Print(Document)
Prints all pages using default print options.
Declaration
public static void Print(this Document document)
Parameters
| Type | Name | Description |
|---|---|---|
| Document | document |
Remarks
Add a reference to DRIT.Pdf.Rendering to bring these methods into scope.
Print(Document, PrintOptions)
Prints pages by rendering them and invoking the optional callback for each page.
Declaration
public static void Print(this Document document, PrintOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Document | document | |
| PrintOptions | options |
Remarks
Add a reference to DRIT.Pdf.Rendering to bring these methods into scope.
Save(Document, Stream, ImageSaveOptions)
Renders a single page of document to a raster image
and writes the encoded bytes to stream.
Declaration
public static void Save(this Document document, Stream stream, ImageSaveOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Document | document | The source PDF document. |
| Stream | stream | Destination stream (must be writable). |
| ImageSaveOptions | options | Image export options (format, page index, width, …). |
Remarks
Add a reference to DRIT.Pdf.Rendering to bring these methods into scope.
Save(Document, string, ImageSaveOptions)
Renders a single page of document to a raster image
and writes it to the file at filePath.
The file is created or overwritten.
Declaration
public static void Save(this Document document, string filePath, ImageSaveOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Document | document | The source PDF document. |
| string | filePath | Destination file path. The extension is not used to determine the format; use |
| ImageSaveOptions | options | Image export options (format, page index, width, …). |
Remarks
Add a reference to DRIT.Pdf.Rendering to bring these methods into scope.