SkipImagesStrategy

SkipImagesStrategy class

Implements an image export strategy that skips saving images during document conversion.

public class SkipImagesStrategy : IImageExportStrategy

Constructors

Name Description
SkipImagesStrategy() The default constructor.

Properties

Name Description
ImagesFolder { get; } Gets an empty string as this strategy does not use an images folder.

Methods

Name Description
GetImageStream(ImageExportContext) Returns null to indicate that the image should be skipped.

Remarks

This strategy is useful when you want to convert a document to Markdown without saving the actual image files. When this strategy is used, the output Markdown will still contain image references (e.g., ), but the actual image files will not be saved to disk.

Examples

The following example shows how to use SkipImagesStrategy when converting a document:

var options = new MarkdownConversionOptions();
options.ImageExportStrategy = new SkipImagesStrategy();

// Convert document without saving images
var markdown = MarkdownConverter.Convert("document.docx", options);
// The markdown will contain image references like ![](img-001.png),
// but the actual image files won't be saved

See Also