Created
April 16, 2024 21:27
-
-
Save conholdate-gists/802a057af6aa2941cc7cf1ab45f96548 to your computer and use it in GitHub Desktop.
Compress Word Documents in C# | DOC DOCX Compressor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load input Word document | |
Aspose.Words.Document doc = new Aspose.Words.Document("input.docx"); | |
// Create an object of OoxmlSaveOptions class | |
Aspose.Words.Saving.OoxmlSaveOptions saveOptions = new Aspose.Words.Saving.OoxmlSaveOptions(Aspose.Words.SaveFormat.Docx); | |
// Use Super Fast compression level for faster and weaker compression | |
saveOptions.CompressionLevel = Aspose.Words.Saving.CompressionLevel.SuperFast; | |
// Save compressed Word DOCX document | |
doc.Save("QuickCompression.docx", saveOptions); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load input Word document | |
Aspose.Words.Document doc = new Aspose.Words.Document("input.docx"); | |
// Create an object of OoxmlSaveOptions class | |
Aspose.Words.Saving.OoxmlSaveOptions saveOptions = new Aspose.Words.Saving.OoxmlSaveOptions(Aspose.Words.SaveFormat.Docx); | |
// Use Maximum Compression Level to apply the strongest and slowest compression | |
saveOptions.CompressionLevel = Aspose.Words.Saving.CompressionLevel.Maximum; | |
// Save compressed Word DOCX document | |
doc.Save("MaxCompression.docx", saveOptions); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment