Save Comparison Result in a Different Format

The simplest way to control the output format of a comparison is to pick a result file path with the matching extension. GroupDocs.Comparison infers the output format from the extension and produces a result file in that format.

Example: Export a DOCX vs DOCX diff to PDF

from groupdocs.comparison import Comparer

def save_comparison_result_in_different_format():
    with Comparer("./source.docx") as comparer:
        comparer.add("./target.docx")
        # Output is inferred from the file extension — .pdf in this case.
        comparer.compare("./result.pdf")

if __name__ == "__main__":
    save_comparison_result_in_different_format()

source.docx is the source file used in this example. Click here to download it.

target.docx is the target file used in this example. Click here to download it.

Binary file (PDF, 25 KB)

Download full output

Supported output formats depend on the source file type. Common targets include DOCX, PDF, and HTML.

Use case: deliver a PDF diff to stakeholders while keeping DOCX for editing.

Close
Loading

Analyzing your prompt, please hold on...

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