Epub to Md

Use GroupDocs.Markdown to convert EPUB, MOBI, and other eBook formats to clean Markdown.

Using static method

The simplest way to convert an eBook file:

using GroupDocs.Markdown;

// Set license (optional)
if (File.Exists("GroupDocs.Markdown.lic")) License.Set("GroupDocs.Markdown.lic");

// Convert EPUB to Markdown string
string markdown = MarkdownConverter.ToMarkdown("business-plan.epub");

// Or save directly to a file
MarkdownConverter.ToFile("business-plan.epub", "export-ebook-static.md");

business-plan.epub is a sample file used in this example. Click here to download it.

![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQsAAABQCAYAAAAOa1DSAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAEHlJREFUeJzt3XlwG9d9wPHvLhYncRIA71sUKUqULFqHbR2xlUqx3dxOk0kzzbR2/2hnOnU7STr9r800f6SdTv9Ims60406OiXPUrq1YdeLEhyzLsiRKIi1SFy/xvm+QAHED/QMSKIgADSUZ05J+n7+0j2/3Pexb/bD78N4+ZbLvVBIhhPgAGkAymSQWSxCLx3PnVECv6dB0unRSPJ4gEo3l3EVVVYwGLb2dSCSJxuIkEonsRSgKek2HTqem02LxONFo7nrpdCoG/a1lJG6UkT0GKoqCXq9Dp66WEY3FicVyl6HpVPS3lBFPJIhG4yST2ctQVQW9pqGqCpDf+dU0HXrtTs6tgkGvoSirZURjceLx7OdW2k/a77dpv4
[TRUNCATED]

Download full output

Using instance API with options

For more control, use the instance API:

using GroupDocs.Markdown;

if (File.Exists("GroupDocs.Markdown.lic")) License.Set("GroupDocs.Markdown.lic");

using var converter = new MarkdownConverter("business-plan.epub");
var options = new ConvertOptions
{
    ImageExportStrategy = new ExportImagesToFileSystemStrategy("images")
    {
        ImagesRelativePath = "images"
    },
    HeadingLevelOffset = 1
};

converter.Convert("export-ebook-instance.md", options);

business-plan.epub is a sample file used in this example. Click here to download it.

export-ebook-instance.md (5 KB)
images/img-001.png (4 KB)
images/img-002.jpg (35 KB)
images/img-003.png (13 KB)

Download full output

For the full list of input formats, see the supported formats page.