Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

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

Select an option

Save conholdate-gists/12566d2dc03237c87f93b82f3fc36ae7 to your computer and use it in GitHub Desktop.
Convert PPTX to Markdown with Conholdate.Total for .NET
using System;
using Conholdate.Total; // Namespace for the conversion library
namespace PptxToMarkdownDemo
{
class Program
{
static void Main(string[] args)
{
// Path to the source PPTX file
string sourcePath = "input.pptx";
// Path where the Markdown file will be saved
string outputPath = "output.md";
try
{
// Initialize the presentation converter
var converter = new PresentationConverter();
// Optional: configure export options (e.g., export images)
converter.Options.MarkdownExportImages = true;
// Perform the conversion
bool success = converter.Convert(sourcePath, outputPath, ExportFormat.Markdown);
if (success)
{
Console.WriteLine($"Conversion succeeded. Markdown saved to: {outputPath}");
}
else
{
Console.WriteLine("Conversion failed. Check the logs for details.");
}
}
catch (Exception ex)
{
Console.WriteLine($"Error during conversion: {ex.Message}");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment