@Groot
The cloud version of Aspose.Words does support document comparison, including the ability to compare .doc
and .docx
files. However, it is important to note that the character-level comparison feature, which provides granularity down to individual characters, is not explicitly mentioned for the cloud version in the available documentation.
To perform a document comparison using the Aspose.Words Cloud API, you can utilize the compareDocumentOnline
method. This method allows you to compare two documents and retrieve the differences between them. The differences will include information about added, deleted, or modified text, along with their locations in the document.
Here’s a basic example of how to use the API for comparing two documents in Python:
import os
import asposewordscloud
from asposewordscloud.models.requests import CompareDocumentOnlineRequest
# Initialize the API client
words_api = asposewordscloud.WordsApi(client_id='YOUR_CLIENT_ID', client_secret='YOUR_CLIENT_SECRET')
# Open the documents to compare
with open('compareTestDoc1.doc', 'rb') as request_document, open('compareTestDoc2.doc', 'rb') as request_comparing_document:
# Prepare the comparison data
compare_data = asposewordscloud.CompareData(author='author', comparing_with_document='TestCompareDocument2.doc', date_time='2015-10-26T00:00:00Z')
# Create the request
compare_request = CompareDocumentOnlineRequest(document=request_document, compare_data=compare_data, comparing_document=request_comparing_document, dest_file_name='CompareDocumentOut.doc')
# Perform the comparison
result = words_api.compare_document_online(compare_request)
print(result)
In this example, replace 'YOUR_CLIENT_ID'
and 'YOUR_CLIENT_SECRET'
with your actual credentials. The result will provide you with the differences between the two documents, which you can then analyze.
If you require character-level granularity specifically, you may need to explore the on-premise version of Aspose.Words, as it is designed to offer more detailed comparison features.
For further details, you can refer to the official documentation on comparing documents using Aspose.Words Cloud here for more information on the API usage and parameters.
Sources:
[1]: Compare two documents - Aspose Documentation