Work with Documents Using LowCode API

Aspose.Words for .NET provides the Aspose.Words.LowCode namespace, which simplifies common document processing tasks. This API is designed for developers who want to accomplish high-level operations such as document comparison, content extraction, image conversion, and text replacement with minimal effort.

The LowCode API is ideal for scenarios where quick implementation is more important than fine-grained control. Let’s take a closer look at the LowCode capabilities of Aspose.Words for .NET.

Available Features in LowCode API

The Aspose.Words.LowCode namespace currently supports:

  • Converting documents from one format to another
  • Comparing documents
  • Mail merging
  • Reporting based on LINQ syntax
  • Merging documents
  • Search and replace
  • Digital signing of documents
  • Splitting a document into parts using different criteria
  • Adding a watermark

Fluent and Non-Fluent API

Aspose.Words for .NET supports both Fluent and Non-Fluent APIs, allowing developers to choose the style that best fits their coding preferences and project needs. Let’s look at some examples to see how these two types of API differ.

Compare Documents

Use LowCode to compare two Word documents and save the result.

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();

Convert Document to Images

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();

Find and Replace Text

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();

Why Use Aspose.Words Low Code

The Aspose.Words.LowCode namespace helps you implement high-level document processing tasks quickly with clean, readable syntax. It is especially useful for developers who need speed, simplicity, and maintainable code when working with Word documents.

To explore more advanced options, you can always combine LowCode APIs with the full Aspose.Words object model. See more Low Code examples in the API documentation.