Browse our Products

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

Installation

The package is available at rubygems.org and it can be installed via gem by executing the following command:

gem install groupdocs_comparison_cloud

Gem Version Gem Total Downloads Ruby-GroupDocsCloud


Requirements

Dependencies

The SDK requires the following gems:

PackageConstraint
addressable~> 2.8.4, >= 2.8.4
faraday~> 0.14.0

Quick Start

Get your API credentials

To use GroupDocs.Comparison Cloud, sign up at GroupDocs.Cloud Dashboard and get your Client ID and Client Secret.

Initialize the API

Use the following code to start using the GroupDocs.Comparison Cloud SDK for Ruby.

require 'groupdocs_comparison_cloud'

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

config = GroupDocsComparisonCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"

compare_api = GroupDocsComparisonCloud::CompareApi.from_config(config)

See the full example in RunExamples.rb.

Compare two documents

Once initialized, use this basic example to compare a source document with a target document in cloud storage.

require 'groupdocs_comparison_cloud'

client_id = "YourClientId"
client_secret = "YourClientSecret"

config = GroupDocsComparisonCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"

apiInstance = GroupDocsComparisonCloud::CompareApi.from_config(config)
source = GroupDocsComparisonCloud::FileInfo.new
source.file_path = "source_files/word/source.docx"
target = GroupDocsComparisonCloud::FileInfo.new
target.file_path = "target_files/word/target.docx"
options = GroupDocsComparisonCloud::ComparisonOptions.new
options.source_file = source
options.target_files = [target]
options.output_path = "output/result.docx"

request = GroupDocsComparisonCloud::ComparisonsRequest.new(options)
response = apiInstance.comparisons(request)

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

See the full example in CompareDocuments.rb.

Get the List of Changes

This example returns the changes between two Word documents.

require 'groupdocs_comparison_cloud'

client_id = "YourClientId"
client_secret = "YourClientSecret"

config = GroupDocsComparisonCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"

apiInstance = GroupDocsComparisonCloud::CompareApi.from_config(config)
source = GroupDocsComparisonCloud::FileInfo.new
source.file_path = "source_files/word/source.docx"
target = GroupDocsComparisonCloud::FileInfo.new
target.file_path = "target_files/word/target.docx"
options = GroupDocsComparisonCloud::ComparisonOptions.new
options.source_file = source
options.target_files = [target]
options.output_path = "output/result.docx"
settings = GroupDocsComparisonCloud::Settings.new
settings.calculate_component_coordinates = 100
options.settings = settings

request = GroupDocsComparisonCloud::PostChangesRequest.new(options)
changes = apiInstance.post_changes(request)
puts("Changes count: " + changes.length.to_s)

See the full example in GetListOfChanges.rb.

Get Document Information

This example reads page information for a document in cloud storage.

require 'groupdocs_comparison_cloud'

client_id = "YourClientId"
client_secret = "YourClientSecret"

config = GroupDocsComparisonCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"

infoApi = GroupDocsComparisonCloud::InfoApi.from_config(config)
file_info = GroupDocsComparisonCloud::FileInfo.new
file_info.file_path = "source_files/word/source.docx"

request = GroupDocsComparisonCloud::GetDocumentInfoRequest.new(file_info)
response = infoApi.get_document_info(request)

puts("GetDocumentInformation completed: " + response.page_count.to_s)

See the full example in GetDocumentInformation.rb.

Get Supported Comparison Formats

Retrieve the document formats the API can compare.

require 'groupdocs_comparison_cloud'

client_id = "YourClientId"
client_secret = "YourClientSecret"

config = GroupDocsComparisonCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"

infoApi = GroupDocsComparisonCloud::InfoApi.from_config(config)
result = infoApi.get_supported_file_formats()
puts("Formats count: " + result.formats.length.to_s)

See the full example in GetSupportedFormats.rb.

Examples on GitHub

The GroupDocs.Comparison Cloud Ruby Examples repository includes ready-to-run examples covering:

CategoryExamples
Basic UsageCompare documents, compare PDF documents, document information, supported formats, preview, license consumption
Advanced UsageMultiple documents, protected documents, sensitivity, change styles, list of changes, revisions, save options

How to run the examples

  1. Clone or download the examples repository
  2. Edit Examples/RunExamples.rb and set your client_id and client_secret
  3. Go to the Examples directory
  4. Run gem install groupdocs_comparison_cloud
  5. Execute ruby RunExamples.rb

For more details, visit Getting Started.


Product Docs Swagger Examples Blog Support Dashboard


Tags

Document Comparison API | Ruby 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



 English