Comprehensive Guide to Settings Data Structure

In this detailed tutorial, you’ll learn how to work with the Settings data structure in GroupDocs.Comparison Cloud API. This powerful structure allows you to configure virtually every aspect of the comparison process, from styling to content handling.

Learning Objectives

  • Master the comprehensive Settings data structure
  • Configure visual appearance of comparison differences
  • Control which types of content are shown in comparison results
  • Implement advanced comparison features like sensitivity and word separation
  • Configure metadata handling and security options

Prerequisites

  • GroupDocs.Comparison Cloud API credentials
  • Advanced understanding of document comparison concepts
  • Familiarity with JSON structures
  • Test documents for comparison operations

Understanding the Settings Structure

The Settings data structure defines additional configuration options for the comparison process, allowing fine-grained control over how documents are compared and how differences are presented.

{
    "GenerateSummaryPage": true,
    "ShowDeletedContent": true,
    "ShowInsertedContent": true,
    "StyleChangeDetection": true,
    "InsertedItemsStyle": {
      "FontColor": "string",
      "HighlightColor": "string",
      "BeginSeparatorString": "string",
      "EndSeparatorString": "string",
      "Bold": true,
      "Italic": true,
      "StrikeThrough": true,
      "Underline": true
    },
    "DeletedItemsStyle": {
      "FontColor": "string",
      "HighlightColor": "string",
      "BeginSeparatorString": "string",
      "EndSeparatorString": "string",
      "Bold": true,
      "Italic": true,
      "StrikeThrough": true,
      "Underline": true
    },
    "ChangedItemsStyle": {
      "FontColor": "string",
      "HighlightColor": "string",
      "BeginSeparatorString": "string",
      "EndSeparatorString": "string",
      "Bold": true,
      "Italic": true,
      "StrikeThrough": true,
      "Underline": true
    },
    "WordsSeparatorChars": [
      "string"
    ],
    "UseFramesForDelInsElements": true,
    "CalculateComponentCoordinates": true,
    "MarkChangedContent": true,
    "MarkNestedContent": true,
    "MetaData": {
      "Author": "string",
      "LastSaveBy": "string",
      "Company": "string"
    },
    "Password": "string",
    "DiagramMasterSetting": {
      "MasterPath": "string",
      "UseSourceMaster": true
    },
    "OriginalSize": {
      "Width": 0,
      "Height": 0
    },
    "HeaderFootersComparison": true,
    "SensitivityOfComparison": 0
}

With over 20 configurable properties, Settings provides comprehensive control over the comparison process.

Implementing Settings in Your Application

Given the complexity of this structure, we’ll break down our implementation into logical sections.

Step 1: Configuring Basic Comparison Settings

Let’s start with the most commonly used settings:

Try it yourself

Create a basic Settings object with the most common options and test it with a comparison operation.

Step 2: Styling Comparison Differences

Now let’s configure the styling options for different types of changes:

Step 3: Advanced Word Processing Settings

For text-based documents, you can fine-tune how words are processed during comparison:

Troubleshooting Tip

If the comparison isn’t detecting changes as expected, try adjusting the SensitivityOfComparison value and WordsSeparatorChars array to better match your document content.

Step 4: Configuring Metadata and Security Options

Control how metadata is handled in the comparison result:

Step 5: Format-Specific Settings

Different document formats may need specific settings:

Step 6: Creating a Comprehensive Settings Configuration

Finally, let’s put everything together for a complete configuration:

Best Practices for Different Document Types

Different document types benefit from specific settings configurations:

Word Processing Documents (DOCX, DOC, RTF)

{
    "GenerateSummaryPage": true,
    "ShowDeletedContent": true,
    "ShowInsertedContent": true,
    "StyleChangeDetection": true,
    "HeaderFootersComparison": true,
    "SensitivityOfComparison": 75,
    "WordsSeparatorChars": [" ", "\t", "\n"]
}

Spreadsheets (XLSX, XLS)

{
    "GenerateSummaryPage": true,
    "ShowDeletedContent": true,
    "ShowInsertedContent": true,
    "StyleChangeDetection": false,
    "CalculateComponentCoordinates": true,
    "SensitivityOfComparison": 100
}

Presentations (PPTX, PPT)

{
    "GenerateSummaryPage": true,
    "ShowDeletedContent": true,
    "ShowInsertedContent": true,
    "StyleChangeDetection": true,
    "CalculateComponentCoordinates": true,
    "MarkChangedContent": true
}

PDF Documents

{
    "GenerateSummaryPage": true,
    "ShowDeletedContent": true,
    "ShowInsertedContent": true,
    "StyleChangeDetection": false,
    "CalculateComponentCoordinates": true,
    "SensitivityOfComparison": 90
}

What You’ve Learned

In this comprehensive tutorial, you’ve learned:

  • How to configure the extensive Settings data structure
  • How to customize the appearance of comparison differences
  • How to control content visibility in comparison results
  • How to fine-tune comparison sensitivity and word processing
  • How to handle metadata and security options
  • Best practices for different document types

You now have the knowledge to create highly customized document comparison operations that meet your specific requirements.

Common Issues and Solutions

IssueSolution
Too many differences detectedDecrease the SensitivityOfComparison value
Missing subtle differencesIncrease the SensitivityOfComparison value
Missing changes in headers/footersSet HeaderFootersComparison to true
Poor performance with large documentsDisable unnecessary features like StyleChangeDetection
Incorrect styling in result documentCheck the styling configurations for inserted/deleted/changed items

Further Practice

Try these exercises to reinforce your learning:

  1. Create settings configurations optimized for different use cases (legal documents, code review, content editing)
  2. Implement a settings builder that helps users configure comparison settings without understanding the JSON structure
  3. Test different sensitivity levels to find the optimal setting for your specific document types

Next Tutorial

Continue your learning journey with our Advanced Tutorial: Working with ChangeInfo Structure tutorial to understand how to manage detailed change information in document comparisons.

Helpful Resources