Specify file type for comparison manually

GroupDocs.Comparison for Python via .NET allows you to manually specify the file type for each input using LoadOptions.

Compare documents from local disk and specify file type manually

Explicitly set input FileType when the extension is ambiguous or missing.

import groupdocs.comparison as gc

source_path = "source.docx"
target_path = "target.docx"
result_path = "result.docx"

# Create load options and set the file type
load_options = gc.LoadOptions()
load_options.file_type = gc.FileType.DOCX

with gc.Comparer(source_path, load_options) as comparer:
    comparer.add(target_path, load_options)
    comparer.compare(result_path)

🔹 Use case: Process files with incorrect or missing extensions by forcing the correct type.

Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.