Nhóm GroupDocs luôn làm việc nhiệt tình để cung cấp các giải pháp vượt trội cho người dùng của họ, về vấn đề này, chúng tôi tự hào công bố bản phát hành đầu tiên của Thế hệ tiếp theo GroupDocs.Comparison Cloud 17.12 API REST cho sử dụng công cộng. Nó là API REST so sánh tài liệu độc lập với nền tảng có thể được tích hợp với bất kỳ ngôn ngữ phát triển nào. API đám mây so sánh tài liệu của chúng tôi đang cung cấp hai tài nguyên chính cho hoạt động so sánh tài liệu, Thay đổi và Tài liệu so sánh cho phép bạn nhận một loạt các thay đổi hoặc nhận đường dẫn hoặc luồng tệp tài liệu kết quả. API này có thể được sử dụng trong các ứng dụng của bạn để có trải nghiệm người dùng tốt hơn và nâng cao hiệu suất. Nó hỗ trợ tất cả các định dạng tài liệu và hình ảnh kinh doanh chính, vui lòng nhấp vào đây để biết thêm chi tiết.

Tính năng - GroupDocs.Comparison Cloud

GroupDocs.Comparison Cloud là API REST để so sánh hầu hết tất cả các định dạng hình ảnh và tài liệu chính, như Word, Cell, Html, PDF, PowerPoint và Image. Một số tính năng chính như sau. Bạn có thể truy cập ghi chú phát hành để biết chi tiết đầy đủ.

Nguồn tài liệu:

Thay đổi tài nguyên:

Nhận các thay đổi từ các tài liệu được so sánh

Bạn có thể nhanh chóng so sánh tài liệu với các tài liệu khác có cùng định dạng. Dưới đây là danh sách các định dạng được hỗ trợ, vui lòng xem ví dụ nhanh về so sánh DOCX với DOCX bằng GroupDocs.Comparison Cloud API.

URL

 https://apireference.groupdocs.cloud/comparison/#!/Changes/PostChanges

Nội dung yêu cầu

{'sourceFile':{'folder':'comparisons','name':'source.docx','password':''},'targetFiles':[{'folder':'comparisons','name':'target.docx','password':''}],'settings ':{'generateSummaryPage':true,'showDeletedContent':true,'styleChangeDetection':true,'insertedItemsStyle':{'color':'Blue','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'deletedItemsStyle':{'color':'Red','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'styleChangedItemsStyle':{'color':'Green','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'wordsSeparatorChars':[],'detailLevel':'Low','useFramesForDelInsElements':false,'calculateComponentCoordinates':false,'markDeletedInsertedContentDeep':false},'changes':[{'id':0,'action':'Reject'},{'id':1,'action':'Reject'}]}"

Ví dụ cURL

curl -v "https://api.groupdocs.cloud/v1.0/comparison/compareDocuments/changes?appsid=XXXX&signature=XXX-XX"
-H "content-type: application/json"
-X POST -d "{'sourceFile':{'folder':'comparisons','name':'source.docx','password':''},'targetFiles':[{'folder':'comparisons','name':'target.docx','password':''}],'settings ':{'generateSummaryPage':true,'showDeletedContent':true,'styleChangeDetection':true,'insertedItemsStyle':{'color':'Blue','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'deletedItemsStyle':{'color':'Red','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'styleChangedItemsStyle':{'color':'Green','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'wordsSeparatorChars':[],'detailLevel':'Low','useFramesForDelInsElements':false,'calculateComponentCoordinates':false,'markDeletedInsertedContentDeep':false},'changes':[{'id':0,'action':'Reject'},{'id':1,'action':'Reject'}]}"

Ví dụ về GoupDocs.So sánh Cloud API .NET SDK

 var configuration = new Configuration

{
    AppSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
    AppKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
};
// Initiate API object
var apiInstance = new ChangesApi(configuration);
try
{
    // Comparison Request
    ComparisonRequest comparisonRequest = new ComparisonRequest()
    {
        // Comparison Request Settings
        Settings = new ComparisonRequestSettings()
        {
            GenerateSummaryPage = true,
            ShowDeletedContent = true,
            StyleChangeDetection = true,
            UseFramesForDelInsElements = false,
            DetailLevel = "Low",
            DeletedItemsStyle = new StyleSettingsValues()
            {
                BeginSeparatorString = "",
                EndSeparatorString = "",
                Color = new Color().Red
            },
            InsertedItemsStyle = new StyleSettingsValues()
            {
               BeginSeparatorString = "",
                EndSeparatorString = "",
               Color = new Color().Blue
            },
            StyleChangedItemsStyle = new StyleSettingsValues()
            {
               BeginSeparatorString = "",
               EndSeparatorString = "",
                Color = new Color().Green
            },
            CalculateComponentCoordinates = false,
            CloneMetadata = "Source",
            MarkDeletedInsertedContentDeep = false,
            MetaData = new ComparisonMetadataValues()
          {
                Author = "GroupDocs",
                Company = "GroupDocs",
                LastSaveBy = "GroupDocs"
          },
            Password = "",
            PasswordSaveOption = ""

        },
        // Source file
        SourceFile = new ComparisonFileInfo()
        {
           Folder = "comparisons",
            Name = "source.docx",
            Password = ""
        }
    };

    List targets = new List();
    // Target file
    targets.Add(new ComparisonFileInfo()
    {
        Folder = "comparisons",
        Name = "target.docx",
        Password = ""
    });
    // Target file - single or multiple target files are allowed.
   comparisonRequest.TargetFiles = targets.ToArray();

    // Accept or Reject changes
    comparisonRequest.Changes = new List();
    comparisonRequest.Changes.Add(new ComparisonChange() { Id = 0, Action = "Accept" });
    comparisonRequest.Changes.Add(new ComparisonChange() { Id = 1, Action = "Reject" });

    // API call for response.

    var response = apiInstance.PostChanges(new Model.Requests.PostChangesRequest() { Request =    comparisonRequest });

    Console.WriteLine(string.Format("{0}: {1}", "response is List", response.Count.ToString()));
}
catch (Exception e)
{
    Console.WriteLine("Exception when calling ChangesApi.PostChanges: " + e.Message);
}

Nhận tài nguyên tài liệu

Bạn có thể so sánh các tài liệu và có thể lấy đường dẫn tài liệu kết quả bằng cách cung cấp dữ liệu Đối tượng JsonRequest trong phần thân yêu cầu. Có thể sử dụng ví dụ API GroupDocs.Comparison Cloud REST sau đây để lấy đường dẫn tài liệu kết quả.

URL

 [`https://apireference.groupdocs.cloud/comparison/#!/Comparison/Comparison`](https://apireference.groupdocs.cloud/comparison/#!/Comparison/Comparison)

Nội dung yêu cầu

{'sourceFile':{'folder':'comparisons','name':'source.docx','password':''},'targetFiles':[{'folder':'comparisons','name':'target.docx','password':''}],'settings ':{'generateSummaryPage':true,'showDeletedContent':true,'styleChangeDetection':true,'insertedItemsStyle':{'color':'Blue','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'deletedItemsStyle':{'color':'Red','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'styleChangedItemsStyle':{'color':'Green','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'wordsSeparatorChars':[],'detailLevel':'Low','useFramesForDelInsElements':false,'calculateComponentCoordinates':false,'markDeletedInsertedContentDeep':false},'changes':[{'id':0,'action':'Reject'},{'id':1,'action':'Reject'}]}"

Ví dụ cURL

curl -v  "https://api.groupdocs.cloud/v1.0/comparison/compareDocuments?outPath=comparisons%2Fcomparedoutput.docx&appsid=XXXX&signature=XXX-XX" 
-H "Content-Type: application/json"
-X POST -d  "{'sourceFile':{'folder':'comparisons','name':'source.docx','password':''},'targetFiles':[{'folder':'comparisons','name':'target.docx','password':''}],'settings
  ':{'generateSummaryPage':true,'showDeletedContent':true,'styleChangeDetection':true,'insertedItemsStyle':{'color':'Blue','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'deletedItemsStyle':{'color':'Red','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'styleChangedItemsStyle':{'color':'Green','beginSeparatorString':'','endSeparatorString':'','bold':false,'italic':false,'strikeThrough':false},'wordsSeparatorChars':[],'detailLevel':'Low','useFramesForDelInsElements':false,'calculateComponentCoordinates':false,'markDeletedInsertedContentDeep':false},'changes':[{'id':0,'action':'Reject'},{'id':1,'action':'Reject'}]}"

Ví dụ về GoupDocs.So sánh Cloud API .NET SDK

 var configuration = new Configuration
{
    AppSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
    AppKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
};

// Initiate API object
var apiInstance = new ComparisonApi(configuration);

try
{
    // Comparison Request
    ComparisonRequest comparisonRequest = new ComparisonRequest()
    {
        // Comparison Request Settings
        Settings = new ComparisonRequestSettings()
        {
            GenerateSummaryPage = true,
            ShowDeletedContent = true,
            StyleChangeDetection = true,
            UseFramesForDelInsElements = false,
            DetailLevel = "Low",
            DeletedItemsStyle = new StyleSettingsValues()
            {
                BeginSeparatorString = "",
                EndSeparatorString = "",
                Color = new Color().Red
            },
            InsertedItemsStyle = new StyleSettingsValues()
            {
                BeginSeparatorString = "",
                EndSeparatorString = "",
                Color = new Color().Blue
            },
            StyleChangedItemsStyle = new StyleSettingsValues()
            {
                BeginSeparatorString = "",
                EndSeparatorString = "",
                Color = new Color().Green
            },
            CalculateComponentCoordinates = false,
            CloneMetadata = "Source",
            MarkDeletedInsertedContentDeep = false,
            MetaData = new ComparisonMetadataValues()
            {
                Author = "GroupDocs",
                Company = "GroupDocs",
                LastSaveBy = "GroupDocs"
            },
            Password = "",
            PasswordSaveOption = ""
        },
        // Source file
        SourceFile = new ComparisonFileInfo()
        {
            Folder = "comparisons",
            Name = "source.docx",
            Password = ""
        }
    };

    List targets = new List();
    // Target file
    targets.Add(new ComparisonFileInfo()
    {
        Folder = "comparisons",
        Name = "target.docx",
        Password = ""
    });
    // Target file - single or multiple target files are allowed.
    comparisonRequest.TargetFiles = targets.ToArray();

    // API call for response.
    var response = apiInstance.Comparison(new Model.Requests.ComparisonRequest() { Request = comparisonRequest, OutPath = "comparisons/compare-result.docx" });

    Console.WriteLine(string.Format("{0}: {1}", "response is Link", response.Href.ToString()));
}
catch (Exception e)
{
    Console.WriteLine("Exception when calling ComparisonApi.Comparison: " + e.Message);
}

Trình khám phá API

GroupDocs Cloud cung cấp trình khám phá API Web để dùng thử API của chúng tôi ngay trong trình duyệt của bạn. Nó là một tập hợp các tài liệu về Swagger dành cho các API Đám mây của GroupDocs. Sử dụng Web API explorer, bạn có thể lấy thông tin về tất cả các tài nguyên trong API. Nó cũng cung cấp thử nghiệm và tính tương tác cho tài liệu điểm cuối API của chúng tôi. Vui lòng nhấp vào tại đây để biết thêm chi tiết.

SDKsGroupDocs.So sánh

API đám mây đang cung cấp SDK để sử dụng các tính năng của nó trong nền tảng yêu thích của bạn, chẳng hạn như .NET. SDK được lưu trữ trên kho lưu trữ GitHub của chúng tôi cùng với các ví dụ hoạt động để giúp bạn bắt đầu ngay lập tức.

GroupDocs.So sánh

Tài nguyên API trên đám mâyBạn có thể truy cập các tài nguyên API sau để bắt đầu và làm việc với API.

Bắt đầu dùng thử miễn phí ngay hôm nay

Bắt đầu dùng thử miễn phí ngay hôm nay – tất cả những gì bạn cần là đăng ký với dịch vụ Đám mây GroupDocs. Sau khi đăng ký, bạn đã sẵn sàng dùng thử các tính năng xử lý tệp mạnh mẽ do GroupDocs Cloud cung cấp.