Skip to content

Instantly share code, notes, and snippets.

@aspose-com-kb
Last active November 24, 2024 14:41
Convert Word DOC to EPUB using C#. For more details: https://kb.aspose.com/words/net/convert-word-doc-to-epub-using-csharp/
using Aspose.Words;
using Aspose.Words.Saving;
class Program
{
static void Main(string[] args)
{
License lic = new License();
lic.SetLicense("license.lic");
Document doc = new Document("SampleFile.docx");
HtmlSaveOptions options = new HtmlSaveOptions
{
DocumentSplitCriteria = DocumentSplitCriteria.HeadingParagraph,
SaveFormat = SaveFormat.Epub,
ExportDocumentProperties = true
};
doc.Save("EPUB/OutputEbook.epub", options);
System.Console.WriteLine("DOCX to EPUB converted successfully");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment