Ooxml Compliance Iso 29500_2008_Strict
In this tutorial, we will explore the C# source code provided to ensure Ooxml Iso 29500_2008_Strict compliance when saving a document using Aspose.Words for .NET. This feature ensures that the generated document complies with ISO 29500_2008_Strict specifications.
Step 1: Setting up the environment
Before you begin, make sure you’ve set up your development environment with Aspose.Words for .NET. Make sure you’ve added the necessary references and imported the appropriate namespaces.
Step 2: Loading the document
// Path to your documents directory
string dataDir = "YOUR DOCUMENTS DIRECTORY";
Document doc = new Document(dataDir + "Document.docx");
In this step, we load the document using the Document
method and passing the path to the DOCX file to load.
Step 3: Configuring OOXML backup options
doc.CompatibilityOptions.OptimizeFor(MsWordVersion.Word2016);
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions() { Compliance = OoxmlCompliance.Iso29500_2008_Strict };
In this step, we configure the OOXML save options using the OptimizeFor
and OoxmlSaveOptions
methods. We optimize document compatibility for Word 2016 version using OptimizeFor
and set compliance to Iso29500_2008_Strict
using Compliance
.
Step 4: Saving the document with Ooxml Iso 29500_2008_Strict compliance
doc.Save(dataDir + "WorkingWithOoxmlSaveOptions.OoxmlComplianceIso29500_2008_Strict.docx", saveOptions);
In this last step, we save the document using the Save
method and passing the path to the output file with the .docx
extension, along with the specified save options.
Now you can run source code to ensure Ooxml Iso 29500_2008_Strict compliance when saving a document. The resulting file will be saved in the specified directory with the name “WorkingWithOoxmlSaveOptions.OoxmlComplianceIso29500_2008_Strict.docx”.
Sample source code for Ooxml Compliance Iso 29500_ 2008_ Strict using Aspose.Words for .NET
// Path to your document directory
string dataDir = "YOUR DOCUMENT DIRECTORY";
Document doc = new Document(dataDir + "Document.docx");
doc.CompatibilityOptions.OptimizeFor(MsWordVersion.Word2016);
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions() { Compliance = OoxmlCompliance.Iso29500_2008_Strict };
doc.Save(dataDir + "WorkingWithOoxmlSaveOptions.OoxmlComplianceIso29500_2008_Strict.docx", saveOptions);
Conclusion
In this tutorial, we explored the Ooxml Iso 29500_2008_Strict compliance feature when saving a document using Aspose.Words for .NET. By specifying Iso29500_2008_Strict compliance with Ooxml save options, we ensure that the generated document meets ISO 29500_2008_Strict standards.
Ooxml Iso 29500_2008_Strict compliance ensures better compatibility with newer versions of Microsoft Word, ensuring document formatting, styles and functionality are preserved. This is particularly important when exchanging documents with other users or when archiving long term.
Aspose.Words for .NET makes it easy to ensure Ooxml Iso 29500_2008_Strict compliance by providing flexible and powerful backup options. You can integrate this functionality into your projects to ensure that the generated documents meet the latest standards.
Feel free to explore other features offered by Aspose.Words for .NET to improve your document handling and optimize your workflow.