Skip to content

Instantly share code, notes, and snippets.

@conholdate-gists
Created June 25, 2024 22:56
Show Gist options
  • Save conholdate-gists/e4ba40ba345c65ec675298a008abbdf5 to your computer and use it in GitHub Desktop.
Save conholdate-gists/e4ba40ba345c65ec675298a008abbdf5 to your computer and use it in GitHub Desktop.
Convert Word DOCX Document to Latex in C# .NET
// Initialize a MemoryStream class object
MemoryStream stream = new MemoryStream();
// Load the input Word document
Aspose.Words.Document document = new Aspose.Words.Document("input.docx");
// Write the intermediate file to a stream
document.Save(stream , Aspose.Words.SaveFormat.Pdf);
// Load the intermediate PDF file
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(stream);
// Instantiate LaTex option
TeXSaveOptions saveOptions = new TeXSaveOptions();
// Save the output LaTex file
doc.Save("WordToLaTeX.tex", saveOptions);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment