Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save conholdate-gists/9d7ca2be9f5e582b154208f6d55c6c25 to your computer and use it in GitHub Desktop.

Select an option

Save conholdate-gists/9d7ca2be9f5e582b154208f6d55c6c25 to your computer and use it in GitHub Desktop.
Convert PPTX to Markdown C# using Conholdate.Total for .NET
using Conholdate.Total;
using Conholdate.Total.Presentation;
using System;
using System.IO;
namespace PptxToMarkdownDemo
{
class Program
{
static void Main(string[] args)
{
// Paths
string inputPath = Path.Combine("Input", "Sample.pptx");
string outputFolder = "Output";
string outputMd = Path.Combine(outputFolder, "Sample.md");
string imageFolder = Path.Combine(outputFolder, "Images");
// Ensure output directories exist
Directory.CreateDirectory(outputFolder);
Directory.CreateDirectory(imageFolder);
// Load presentation
var presentation = new Presentation();
presentation.Load(inputPath);
// Set export options
var options = new PresentationExportOptions
{
ImageFolder = imageFolder,
IncludeNotes = true // optional: include slide notes
};
// Export to Markdown
presentation.Export(outputMd, ExportFormat.Markdown, options);
Console.WriteLine($"Conversion complete. Markdown saved to: {outputMd}");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment