Skip to content

Instantly share code, notes, and snippets.

@groupdocs-cloud-gists
Last active July 29, 2024 21:57
Show Gist options
  • Save groupdocs-cloud-gists/6a9c6dd6b6872fb79c14779a91e9252b to your computer and use it in GitHub Desktop.
Save groupdocs-cloud-gists/6a9c6dd6b6872fb79c14779a91e9252b to your computer and use it in GitHub Desktop.
compare PDF files
// More examples over https://github.com/groupdocs-comparison-cloud/groupdocs-comparison-cloud-dotnet
// Obtain your API credentials
string clientId = "XXXXXXX-XXXXXXX-4088-XXXXX-55c38f4b7f22";
string clientSecret1 = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
// create configuration object while passing client credentials
var configuration = new Configuration(clientId, clientSecret);
// create an instnace of ComparisonAPI
var comparisonApiInstance = new CompareApi(configuration);
var options = new ComparisonOptions
{
// name of first PDF file
SourceFile = new GroupDocs.Comparison.Cloud.Sdk.Model.FileInfo
{
FilePath = "Binder1(1).pdf"
},
// name of target PDF which is used for comparison
TargetFiles = new List<GroupDocs.Comparison.Cloud.Sdk.Model.FileInfo> {
new GroupDocs.Comparison.Cloud.Sdk.Model.FileInfo {
FilePath = "Binder1_modified.pdf"
}
}
};
// initialize the comparison operation
var request = new PostChangesRequest(options);
var changes = comparisonApiInstance.PostChanges(request);
Learn how to compare two PDF files online.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment