
Developers working with Word documents often face repetitive, complex tasks such as comparing files, converting documents from one format to another, replacing content, and others. With Aspose.Words for .NET, you can now streamline these common operations with a new LowCode API designed to save time and reduce complexity.
The Aspose.Words.LowCode namespace offers high-level operations with a clean and minimal syntax — perfect for projects where fast results are more important than low-level control.
What Is Low Code in Aspose.Words?
The LowCode API is a simplified interface over the standard document model. It is not intended for document structural editing. Instead, it is optimized for tasks that do not require full access to the document object model:
- Compare documents
- Convert file formats
- Find and replace text
- Perform mail merge operation
- Digitally sign documents
- Merge or split documents
- Add watermarks
- Run LINQ-based reports
Using Fluent API
Aspose.Words supports both Fluent and Non-Fluent API styles. You can choose the approach that best fits your coding preferences:
- Fluent API is concise and chainable
- Non-Fluent API is more explicit and easier to debug in complex workflows
Popular User Scenarios
Let’s look at some popular user scenarios and how they can be implemented using Fluent API and Non-Fluent API.
Convert Documents to Images or PDF
You can convert documents from one format to another using the available loading and saving formats.
Use LowCode
to convert Word document to PDF.
non-fluent api example:
string inputDoc = "Input.docx";
string outputDoc = "Output.pdf";
Converter.Convert(inputDoc, outputDoc);
fluent api example:
string inputDoc = "Input.docx";
string outputDoc = "Output.pdf";
Converter.Create()
.From(inputDoc)
.To(outputDoc)
.Execute();
Compare Documents
You can compare documents, including documents in different formats, and see the differences as revisions.
Use LowCode
to compare two Word documents and save the result.
non-non-fluent api example:
string firstDoc = "Document1.docx";
string secondDoc = "Document2.docx";
string outputDoc = "Compared.docx";
LowCodeComparer.Compare(firstDoc, secondDoc, outputDoc);
fluent api example:
string firstDoc = "Document1.docx";
string secondDoc = "Document2.doc";
Comparer.Create()
.From(firstDoc)
.From(secondDoc)
.To("CompareDocuments.1.docx")
.Execute();
You can also pass CompareOptions
for fine-tuned comparison.
non-fluent api example:
string firstDoc = "Document1.docx";
string secondDoc = "Document2.docx";
string outputDoc = "Compared.docx";
CompareOptions options = new CompareOptions
{
IgnoreFormatting = true,
IgnoreCaseChanges = true
};
LowCodeComparer.Compare(firstDoc, secondDoc, outputDoc, options);
fluent api example:
string firstDoc = "Document1.docx";
string secondDoc = "Document2.doc";
ComparerContext comparerContext = new ComparerContext();
comparerContext.CompareOptions.IgnoreCaseChanges = true;
Comparer.Create(comparerContext)
.From(firstDoc)
.From(secondDoc)
.To("CompareDocuments.3.docx")
.Execute();
Find and Replace Text
You can perform a find and replace operation using a simple string search or regular expressions.
Use LowCode
to quickly replace text across the entire document.
non-fluent api example:
string inputDoc = "Input.docx";
string outputDoc = "Output.docx";
string pattern = "Aspose";
string replacement = "Aspose Pro";
Replacer.Replace(inputDoc, outputDoc, pattern, replacement);
fluent api example:
string inputDoc = "Input.docx";
string outputDoc = "Output.docx";
ReplacerContext replacerContext = new ReplacerContext();
replacerContext.SetReplacement("ReplaceMe", "Replacement");
Replacer.Create(replacerContext)
.From(inputDoc)
.To(outputDoc)
.Execute();
An example of performing a find and replace operation:
Summary
The Aspose.Words.LowCode namespace is a powerful addition for developers who want to get more done with less code. Whether you’re automating comparisons, generating PDFs, or performing batch replacements, LowCode gives you a fast, reliable, and clean syntax to work with.
You can always combine LowCode methods with the full Aspose.Words API for more advanced or custom scenarios.