We're sorry GroupDocsCloud doesn't work properply without JavaScript enabled.

Free Support Forum - groupdocs.cloud

Not able to read sourceand target files while compairing 2 pdfs

I have tried using the full paths as well. I am not quite sure why this is happening.

This is the error:
groupdocs_comparison_cloud.api_exception.ApiException: (errorItemNotFound)
Message: Can’t find file located at ‘/document_comparison_direct_pdfs/small_doc_src.pdf’.

The code:
import groupdocs_comparison_cloud

# set
client_id = "abc"
client_secret = "cde"

configuration = groupdocs_comparison_cloud.Configuration(client_id, client_secret)
configuration.api_base_url = "https://api.groupdocs.cloud"
my_storage = ""

# This code example demonstrates how to compare two PDF files.
# Create an instance of the API
api_instance = groupdocs_comparison_cloud.CompareApi.from_keys(client_id, client_secret)

# Input source file
source = groupdocs_comparison_cloud.FileInfo()
source.file_path = "/document_comparison_direct_pdfs/small_doc_src.pdf"

# Target file
target = groupdocs_comparison_cloud.FileInfo()
target.file_path = "/document_comparison_direct_pdfs/small_doc_dest.pdf"

# Define comparison options
options = groupdocs_comparison_cloud.ComparisonOptions()
options.source_file = source
options.target_files = [target]
options.output_path = "/document_comparison_direct_pdfs/result.pdf"

# Create comparison request
request = groupdocs_comparison_cloud.ComparisonsRequest(options)

# compare
response = api_instance.comparisons(request)

# Display changes
for change in response:
  print("Change # " + str(change.id + 1) + "- Target Text: " + str(change.target_text) + ", Text: " + str(change.text) + ", Type: " + str(change.type))


Please note that the Comparison API method compares documents from cloud storage. So kindly ensure that your source and target PDF documents exist in the document_comparison_direct_pdfs folder of your default cloud storage. If the problem persists, please send your credentials (Client ID and Client Secret) via a private message so that we can investigate.