ExportImagesToFileSystemStrategy
Leave feedback
On this page
Inheritance: java.lang.Object
All Implemented Interfaces: com.groupdocs.markdown.IImageExportStrategy
public class ExportImagesToFileSystemStrategy implements IImageExportStrategy
Saves images to a folder on disk during conversion.
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 \u2014 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 | Description |
|---|---|
| ExportImagesToFileSystemStrategy(String imagesFolder) | Initializes a new instance. |
| Method | Description |
|---|---|
| getImagesFolder() | Gets the physical folder where images will be saved on disk. |
| getImagesRelativePath() | Gets or sets the path used in Markdown image references. |
| setImagesRelativePath(String imagesRelativePath) | |
| getImageStream(ImageExportContext context) | Gets a stream for writing the exported image to the file system. |
public ExportImagesToFileSystemStrategy(String imagesFolder)
Initializes a new instance.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| imagesFolder | java.lang.String | physical folder where images will be saved |
public String getImagesFolder()
Gets the physical folder where images will be saved on disk.
Returns: java.lang.String
public String getImagesRelativePath()
Gets or sets the path used in Markdown image references.
Returns: java.lang.String
public void setImagesRelativePath(String imagesRelativePath)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| imagesRelativePath | java.lang.String |
public OutputStream getImageStream(ImageExportContext context)
Gets a stream for writing the exported image to the file system.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| context | ImageExportContext |
Returns: java.io.OutputStream
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.