public class ExportImagesToFileSystemStrategy extends Object implements IImageExportStrategy
By default, the Markdown output references images using the full imagesFolder path.
Set imagesRelativePath to control the path that appears in the Markdown image links
— typically a path relative to the output .md file.
Example:
ExportImagesToFileSystemStrategy strategy =
new ExportImagesToFileSystemStrategy("c:/output/images");
strategy.setImagesRelativePath("images");
ConvertOptions options = new ConvertOptions();
options.setImageExportStrategy(strategy);
MarkdownConverter.toFile("document.docx", "c:/output/doc.md", options);
// Markdown: 
// File: c:/output/images/img-001.png
| Constructor and Description |
|---|
ExportImagesToFileSystemStrategy(String imagesFolder)
Initializes a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getImagesFolder()
Gets the physical folder where images will be saved on disk.
|
String |
getImagesRelativePath()
Gets or sets the path used in Markdown image references.
|
OutputStream |
getImageStream(ImageExportContext context)
Gets a stream for writing the exported image to the file system.
|
void |
setImagesRelativePath(String imagesRelativePath) |
public ExportImagesToFileSystemStrategy(String imagesFolder)
imagesFolder - physical folder where images will be savedpublic String getImagesFolder()
getImagesFolder in interface IImageExportStrategypublic String getImagesRelativePath()
public void setImagesRelativePath(String imagesRelativePath)
public OutputStream getImageStream(ImageExportContext context)
getImageStream in interface IImageExportStrategycontext - The image export context containing the default image file name and other metadata.
You may modify imageFileName before returning the stream to change the file name
that appears in the Markdown output.null to use the default behaviorCopyright © 2026. All rights reserved.