Save image as file

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Markdown MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-markdown -- dnx GroupDocs.Markdown.Mcp --yes
Folders, licensing and more →

Use ExportImagesToFileSystemStrategy to save images as separate files during conversion. The Markdown output will contain image references pointing to the exported files.

Basic usage

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)

Download full output

Using ImagesRelativePath

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: ![](images/img-001.png)
// 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)

Download full output