Περιηγηθείτε στα Προϊόντα μας

If so you can download any of the below versions for testing. The product will function as normal except for an evaluation limitation. At the time of purchase we provide a license file via email that will allow the product to work in its full capacity. If you would also like an evaluation license to test without any restrictions for 30 days, please follow the directions provided here.


Product Docs Swagger Examples Blog Support Dashboard

Εγκατάσταση

Το πακέτο είναι available στο PyPI και μπορεί να εγκατασταθεί μέσω pip εκτελώντας την παρακάτω εντολή:

pip install groupdocs-comparison-cloud

PyPI - Version PyPI - Downloads Python-GroupDocsCloud


Απαιτήσεις

  • Python 2.7 ή 3.4+
  • pip διαχειριστής πακέτων
  • Διαπιστευτήρια GroupDocs CloudClient ID and Client Secret από τον πίνακα ελέγχου

Εξαρτήσεις

Το SDK εγκαθιστά αυτόματα τα ακόλουθα πακέτα:

ΠακέτοΠεριορισμός
urllib3>= 1.15
six>= 1.10
certifi
python-dateutil

Γρήγορη εκκίνηση

Λάβετε τα διαπιστευτήρια API σας

Για να χρησιμοποιήσετε το GroupDocs.Comparison Cloud, εγγραφείτε στο GroupDocs.Cloud Dashboard και λάβετε το Client ID και το Client Secret.

Εκκινήστε το API

Χρησιμοποιήστε τον ακόλουθο κώδικα για να ξεκινήσετε να χρησιμοποιείτε το GroupDocs.Comparison Cloud SDK για Python:

import groupdocs_comparison_cloud

# Get your ClientId and ClientSecret at https://dashboard.groupdocs.cloud
client_id = "YourClientId"
client_secret = "YourClientSecret"

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

# Create instance of the Compare API
compare_api = groupdocs_comparison_cloud.CompareApi.from_config(configuration)

Συγκρίνετε δύο έγγραφα

Μόλις αρχικοποιηθεί, χρησιμοποιήστε αυτό το βασικό παράδειγμα για να συγκρίνετε έγγραφα του Word και να αποθηκεύσετε το αποτέλεσμα:

import groupdocs_comparison_cloud

compare_api = groupdocs_comparison_cloud.CompareApi.from_keys("YourClientId", "YourClientSecret")

source = groupdocs_comparison_cloud.FileInfo()
source.file_path = "source_files/word/source.docx"
target = groupdocs_comparison_cloud.FileInfo()
target.file_path = "target_files/word/target.docx"
options = groupdocs_comparison_cloud.ComparisonOptions()
options.source_file = source
options.target_files = [target]
options.output_path = "output/result.docx"

response = compare_api.comparisons(groupdocs_comparison_cloud.ComparisonsRequest(options))

print("Output file link: " + response.href)

Με αυτόν τον οδηγό γρήγορης εκκίνησης, είστε έτοιμοι να αρχίσετε να συγκρίνετε έγγραφα χρησιμοποιώντας το GroupDocs.Comparison Cloud στις εφαρμογές σας Python. Για περισσότερες λεπτομέρειες, επισκεφθείτε το documentation.

Λάβετε υποστηριζόμενες μορφές αρχείων

Ανακτήστε την πλήρη λίστα των υποστηριζόμενων μορφών αρχείων που είναι διαθέσιμες μέσω του API σύγκρισης.

import groupdocs_comparison_cloud

info_api = groupdocs_comparison_cloud.InfoApi.from_keys("YourClientId", "YourClientSecret")

result = info_api.get_supported_file_formats()

print("Formats count: " + str(len(result.formats)))

Συγκρίνετε έγγραφα PDF

Συγκρίνετε δύο έγγραφα PDF και αποθηκεύστε το αποτέλεσμα με επισημασμένες τις παρακολουθούμενες αλλαγές.

import groupdocs_comparison_cloud

compare_api = groupdocs_comparison_cloud.CompareApi.from_keys("YourClientId", "YourClientSecret")

source = groupdocs_comparison_cloud.FileInfo()
source.file_path = "source_files/pdf/source.pdf"
target = groupdocs_comparison_cloud.FileInfo()
target.file_path = "target_files/pdf/target.pdf"
options = groupdocs_comparison_cloud.ComparisonOptions()
options.source_file = source
options.target_files = [target]
options.output_path = "output/result.pdf"

response = compare_api.comparisons(groupdocs_comparison_cloud.ComparisonsRequest(options))

print("Output file link: " + response.href)

Συγκρίνετε έγγραφα που προστατεύονται με κωδικό πρόσβασης

Συγκρίνετε δύο έγγραφα Word που προστατεύονται με κωδικό πρόσβασης παρέχοντας διαπιστευτήρια για κάθε αρχείο.

import groupdocs_comparison_cloud

compare_api = groupdocs_comparison_cloud.CompareApi.from_keys("YourClientId", "YourClientSecret")

source = groupdocs_comparison_cloud.FileInfo()
source.file_path = "source_files/word/source_protected.docx"
source.password = "1231"
target = groupdocs_comparison_cloud.FileInfo()
target.file_path = "target_files/word/target_protected.docx"
target.password = "5784"
options = groupdocs_comparison_cloud.ComparisonOptions()
options.source_file = source
options.target_files = [target]
options.output_path = "output/result.docx"

response = compare_api.comparisons(groupdocs_comparison_cloud.ComparisonsRequest(options))

print("Output file link: " + response.href)

Λήψη λίστας αλλαγών

Ανακτήστε μια λεπτομερή λίστα με όλες τις αλλαγές που εντοπίστηκαν μεταξύ των εγγράφων προέλευσης και προορισμού.

import groupdocs_comparison_cloud

compare_api = groupdocs_comparison_cloud.CompareApi.from_keys("YourClientId", "YourClientSecret")

source = groupdocs_comparison_cloud.FileInfo()
source.file_path = "source_files/word/source.docx"
target = groupdocs_comparison_cloud.FileInfo()
target.file_path = "target_files/word/target.docx"
options = groupdocs_comparison_cloud.ComparisonOptions()
options.source_file = source
options.target_files = [target]
options.output_path = "output/result.docx"

changes = compare_api.post_changes(groupdocs_comparison_cloud.PostChangesRequest(options))

print("Changes count: " + str(len(changes)))

Αποδοχή ή απόρριψη αλλαγών

Αποδεχτείτε ή απορρίψτε μεμονωμένες αλλαγές μετά τη σύγκριση εγγράφων και αποθηκεύστε το ενημερωμένο αποτέλεσμα.

import groupdocs_comparison_cloud

compare_api = groupdocs_comparison_cloud.CompareApi.from_keys("YourClientId", "YourClientSecret")

source = groupdocs_comparison_cloud.FileInfo()
source.file_path = "source_files/word/source.docx"
target = groupdocs_comparison_cloud.FileInfo()
target.file_path = "target_files/word/target.docx"
options = groupdocs_comparison_cloud.UpdatesOptions()
options.source_file = source
options.target_files = [target]
options.output_path = "output/result.docx"

changes = compare_api.post_changes(groupdocs_comparison_cloud.PostChangesRequest(options))

for change in changes:
    change.comparison_action = "Reject"
changes[0].comparison_action = "Accept"

options.changes = changes

response = compare_api.put_changes_document(groupdocs_comparison_cloud.PutChangesDocumentRequest(options))

print("Output file link: " + response.href)

Συγκρίνετε πολλά έγγραφα με επιλογές

Συγκρίνετε ένα έγγραφο προέλευσης με πολλούς στόχους και προσαρμόστε την εμφάνιση των στοιχείων που έχουν εισαχθεί.

import groupdocs_comparison_cloud

compare_api = groupdocs_comparison_cloud.CompareApi.from_keys("YourClientId", "YourClientSecret")

source = groupdocs_comparison_cloud.FileInfo()
source.file_path = "source_files/word/source.docx"
target = groupdocs_comparison_cloud.FileInfo()
target.file_path = "target_files/word/target.docx"
target1 = groupdocs_comparison_cloud.FileInfo()
target1.file_path = "target_files/word/target_1.docx"
target2 = groupdocs_comparison_cloud.FileInfo()
target2.file_path = "target_files/word/target_2.docx"
options = groupdocs_comparison_cloud.ComparisonOptions()
options.source_file = source
options.target_files = [target, target1, target2]
options.output_path = "output/result.docx"
settings = groupdocs_comparison_cloud.Settings()
settings.inserted_items_style = groupdocs_comparison_cloud.ItemsStyle()
settings.inserted_items_style.font_color = "16711680"
options.settings = settings

response = compare_api.comparisons(groupdocs_comparison_cloud.ComparisonsRequest(options))

print("Output file link: " + response.href)

Εφαρμογή αναθεωρήσεων σε έγγραφα DOCX

Αποδεχτείτε ή απορρίψτε τις παρακολουθούμενες αναθεωρήσεις σε ένα έγγραφο του Word μέσω προγραμματισμού.

import groupdocs_comparison_cloud

review_api = groupdocs_comparison_cloud.ReviewApi.from_keys("YourClientId", "YourClientSecret")

source = groupdocs_comparison_cloud.FileInfo()
source.file_path = "source_files/word/source_with_revs.docx"
options = groupdocs_comparison_cloud.ApplyRevisionsOptions()
options.source_file = source
options.output_path = "output/result.docx"

revisions = review_api.get_revisions(groupdocs_comparison_cloud.GetRevisionsRequest(source))

for revision in revisions:
    revision.action = "Accept"

options.revisions = revisions

response = review_api.apply_revisions(groupdocs_comparison_cloud.ApplyRevisionsRequest(options))

print("Output file link: " + response.href)

Δείγματα έργων στο GitHub

Ο GroupDocs.Comparison Cloud Python Samples το αποθετήριο περιλαμβάνει έτοιμα προς εκτέλεση παραδείγματα που καλύπτουν:

ΚατηγορίαΠαραδείγματα
Βασική ΧρήσηΥποστηριζόμενες μορφές, πληροφορίες εγγράφων, σύγκριση εγγράφων, σύγκριση εγγράφων PDF, προεπισκόπηση εγγράφου
AdvancedUsage — CompareMultipleDocumentsΣυγκρίνετε πολλά έγγραφα με επιλογές, συγκρίνετε πολλαπλά προστατευμένα έγγραφα
AdvancedUsage — ΑναθεωρήσειςΛήψη λίστας αναθεωρήσεων, εφαρμογή αναθεωρήσεων, αποδοχή όλων των αναθεωρήσεων, απόρριψη όλων των αναθεωρήσεων
AdvancedUsage — SaveOptionsΟρισμός μεταδεδομένων, ορισμός κωδικού πρόσβασης στην αποθήκευση
AdvancedUsage — Αλλαγή ελέγχουΑποδοχή ή απόρριψη αλλαγών, σύγκριση προστατευμένων εγγράφων, σύγκριση ευαισθησίας, προσαρμογή στυλ αλλαγής, λήψη συντεταγμένων αλλαγών, λήψη λίστας αλλαγών

Πώς να εκτελέσετε τα παραδείγματα

  1. Κλωνοποιήστε ή κατεβάστε το samples repository2. Επεξεργασία Examples/RunExamples.py και ρυθμίστε το δικό σας client_id και client_secret3. Πηγαίνετε στο Examples καταλόγου
  2. Τρέξε pip install groupdocs-comparison-cloud -U5. Εκτελέστε python RunExamples.py

Για περισσότερες λεπτομέρειες, επισκεφθείτε Getting Started.


Product Docs Swagger Examples Blog Support Dashboard


Ετικέτες

Document Comparison API | Python Cloud API | GroupDocs.Comparison Cloud | REST API | Document Comparison | Folder Comparison | Revision Control | Track Changes | Preview Generation | Multi-format Support | Password Protected Documents | Source Code Comparison | Change Tracking | Customization | Document Merging | Change Coordinates | Metadata Extraction | Document Security | Document Review | Secure API Access | Cloud Storage Integration | Cross-platform API


 Ελληνικά