Save image as file
Leave feedback
Use ExportImagesToFileSystemStrategy to save images as separate files during conversion. The Markdown output will contain image references pointing to the exported files.
using GroupDocs.Markdown;
var options = new ConvertOptions
{
ImageExportStrategy = new ExportImagesToFileSystemStrategy("output/images")
};
MarkdownConverter.ToFile("business-plan.pdf", "output/document.md", options);
business-plan.pdf is a sample file used in this example. Click here to download it.
output/document.md (7 KB)
output/images/img-001.png (3 KB)
output/images/img-002.jpg (73 KB)
output/images/img-003.jpg (76 KB)
By default, image references in the Markdown use the full ImagesFolder path. Set ImagesRelativePath to produce portable, relative image links:
using GroupDocs.Markdown;
var strategy = new ExportImagesToFileSystemStrategy("output/images")
{
ImagesRelativePath = "images"
};
var options = new ConvertOptions
{
ImageExportStrategy = strategy
};
MarkdownConverter.ToFile("business-plan.pdf", "output/document.md", options);
// Markdown output contains: 
// Image file saved to: output/images/img-001.png
business-plan.pdf is a sample file used in this example. Click here to download it.
output/document.md (7 KB)
output/images/img-001.png (3 KB)
output/images/img-002.jpg (73 KB)
output/images/img-003.jpg (76 KB)
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.