Class WorkbookPdfExporter
Extension methods that export a Workbook to PDF.
Inherited Members
Namespace: DRIT.Spreadsheet.Export.Pdf
Assembly: DRIT.Spreadsheet.dll
Syntax
public static class WorkbookPdfExporter
Methods
BuildPdfDocument(Workbook, WorkbookPdfSaveOptions)
Builds and returns a Document from the workbook. The caller is responsible for disposing the returned document.
Declaration
public static Document BuildPdfDocument(this Workbook workbook, WorkbookPdfSaveOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Workbook | workbook | The workbook to export. |
| WorkbookPdfSaveOptions | options | Export options; a default instance is used when null. |
Returns
| Type | Description |
|---|---|
| Document |
SaveAsEncryptedPdf(Workbook, Stream, PasswordEncryption, WorkbookPdfSaveOptions)
Writes an encrypted PDF representation of the workbook to stream.
Declaration
public static void SaveAsEncryptedPdf(this Workbook workbook, Stream stream, PasswordEncryption encryption, WorkbookPdfSaveOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Workbook | workbook | The workbook to export. |
| Stream | stream | A writable stream that receives the PDF bytes. |
| PasswordEncryption | encryption | Password encryption settings applied to the generated PDF. |
| WorkbookPdfSaveOptions | options | Export options; a default instance is used when null. |
SaveAsEncryptedPdf(Workbook, string, PasswordEncryption, WorkbookPdfSaveOptions)
Exports the workbook to an encrypted PDF file.
Declaration
public static void SaveAsEncryptedPdf(this Workbook workbook, string filePath, PasswordEncryption encryption, WorkbookPdfSaveOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Workbook | workbook | The workbook to export. |
| string | filePath | Destination file path. The file is created or overwritten. |
| PasswordEncryption | encryption | Password encryption settings applied to the generated PDF. |
| WorkbookPdfSaveOptions | options | Export options; a default instance is used when null. |
SaveAsPdf(Workbook, Stream, WorkbookPdfSaveOptions)
Writes a PDF representation of the workbook to stream.
Declaration
public static void SaveAsPdf(this Workbook workbook, Stream stream, WorkbookPdfSaveOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Workbook | workbook | The workbook to export. |
| Stream | stream | A writable stream that receives the PDF bytes. |
| WorkbookPdfSaveOptions | options | Export options; a default instance is used when null. |
SaveAsPdf(Workbook, Stream, CancellationToken)
Writes a PDF representation of the workbook to stream,
stopping immediately if cancellationToken is cancelled.
Declaration
public static void SaveAsPdf(this Workbook workbook, Stream stream, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| Workbook | workbook | |
| Stream | stream | |
| CancellationToken | cancellationToken |
SaveAsPdf(Workbook, string, WorkbookPdfSaveOptions)
Saves the workbook as a PDF file at filePath.
Declaration
public static void SaveAsPdf(this Workbook workbook, string filePath, WorkbookPdfSaveOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Workbook | workbook | The workbook to export. |
| string | filePath | Destination file path. The file is created or overwritten. |
| WorkbookPdfSaveOptions | options | Export options; a default instance is used when null. |
SaveAsPdf(Workbook, string, CancellationToken)
Saves the workbook as a PDF file at filePath,
stopping immediately if cancellationToken is cancelled.
Declaration
public static void SaveAsPdf(this Workbook workbook, string filePath, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| Workbook | workbook | |
| string | filePath | |
| CancellationToken | cancellationToken |
SaveAsSignedPdf(Workbook, Stream, Signer, WorkbookPdfSaveOptions, string)
Writes a digitally signed PDF representation of the workbook to stream.
Declaration
public static void SaveAsSignedPdf(this Workbook workbook, Stream stream, Signer signer, WorkbookPdfSaveOptions options = null, string signatureFieldName = "Signature1")
Parameters
| Type | Name | Description |
|---|---|---|
| Workbook | workbook | The workbook to export. |
| Stream | stream | A writable stream that receives the PDF bytes. |
| Signer | signer | Signer used to produce the detached CMS signature. |
| WorkbookPdfSaveOptions | options | Export options; a default instance is used when null. |
| string | signatureFieldName | Optional signature field name. Defaults to |
SaveAsSignedPdf(Workbook, string, Signer, WorkbookPdfSaveOptions, string)
Exports the workbook to a digitally signed PDF file.
Declaration
public static void SaveAsSignedPdf(this Workbook workbook, string filePath, Signer signer, WorkbookPdfSaveOptions options = null, string signatureFieldName = "Signature1")
Parameters
| Type | Name | Description |
|---|---|---|
| Workbook | workbook | The workbook to export. |
| string | filePath | Destination file path. The file is created or overwritten. |
| Signer | signer | Signer used to produce the detached CMS signature. |
| WorkbookPdfSaveOptions | options | Export options; a default instance is used when null. |
| string | signatureFieldName | Optional signature field name. Defaults to |