public class ExportImagesAsBase64Strategy extends Object implements IImageExportStrategy
This strategy converts all images to Base64 format and embeds them directly in the Markdown document using the data URI scheme. This eliminates the need for separate image files, making the Markdown document self-contained. However, this approach increases the size of the Markdown file and may not be supported by all Markdown viewers.
Example:
MarkdownConversionOptions options = new MarkdownConversionOptions();
options.setImageExportStrategy(new ExportImagesAsBase64Strategy());
// Convert document with embedded Base64 images
String markdown = MarkdownConverter.convert("document.docx", options);
// The markdown will contain embedded images like:
// 
| Constructor and Description |
|---|
ExportImagesAsBase64Strategy() |
| Modifier and Type | Method and Description |
|---|---|
String |
getImagesFolder()
Gets an empty string as this strategy does not use an images folder.
|
OutputStream |
getImageStream(ImageExportContext context)
Returns
null to indicate that the image should be embedded as Base64. |
public String getImagesFolder()
getImagesFolder in interface IImageExportStrategypublic OutputStream getImageStream(ImageExportContext context)
null to indicate that the image should be embedded as Base64.getImageStream in interface IImageExportStrategycontext - The image export context (not used in this implementation).null to indicate Base64 embedding.Copyright © 2026. All rights reserved.