DocumentConverterOptions
Contents
[
Hide
]
DocumentConverterOptions class
Provides options for customizing the document conversion process to Markdown format.
public class DocumentConverterOptions : LoadOptions
Constructors
Name | Description |
---|---|
DocumentConverterOptions() | Initializes a new instance of the DocumentConverterOptions class. |
Properties
Name | Description |
---|---|
Extension { get; set; } | Gets or sets the file extension of the stream. |
FileFormat { get; } | Gets the exact type of the file that is to be loaded. The default value is Unknown which means that the type should be detected automatically. |
ImageExportStrategy { get; set; } | Gets or sets the strategy for handling image export during document conversion. |
MimeType { get; set; } | Gets or sets the MIME type of the stream. |
PageNumbers { get; set; } | Gets or sets an array of page or worksheet numbers to convert. Numbering starts from 1. |
Password { get; set; } | Gets or sets the password for opening an encrypted document. |
Remarks
This class allows you to configure how documents are converted to Markdown, particularly how images are handled during the conversion process. By default, images are embedded as Base64 strings in the Markdown output.
Examples
The following examples show different ways to configure document conversion options:
// Example 1: Using default options (images embedded as Base64)
var defaultOptions = new DocumentConverterOptions();
// Images will be embedded as Base64 strings in the Markdown
// Example 2: Saving images to a folder
var fileSystemOptions = new DocumentConverterOptions
{
ImageExportStrategy = new ExportImagesToFileSystemStrategy("output/images")
};
// Images will be saved to the "output/images" folder
// Example 3: Skipping image export
var skipImagesOptions = new DocumentConverterOptions
{
ImageExportStrategy = new SkipImagesStrategy()
};
// Images will be referenced but not saved
// Example 4: Using custom image export strategy
var customOptions = new DocumentConverterOptions
{
ImageExportStrategy = new CustomImageExportStrategy()
};
// Images will be handled according to the custom strategy
See Also
- class LoadOptions
- namespace GroupDocs.Markdown
- assembly GroupDocs.Markdown