If you need to compare two documents, you can use Document Builder. The steps below will show you how to do it:
Create the compare.docbuilder script file with the following code:
var file = builderJS.OpenTmpFile("https://example.com/file2.docx");
AscCommonWord.CompareDocuments(Api, file, null);
https://example.com/file1.docx - the path to the first file for comparing,
https://example.com/file2.docx - the path to the second file for comparing.
Send the POST request to https://documentserver/docbuilder with the following body in the JSON format:
https://example.com/compare.docbuilder - the path to the .docbuilder script.
Once the document generation is ready, the response with the absolute URL to the output file of document comparing will be returned:
Download the document from the received link. Now you can check all the document differences and accept or reject them using the corresponding buttons on the top toolbar.