계약서, 연구 논문 또는 기술 문서의 여러 버전을 작업할 때, Word 문서를 비교할 수 있는 능력은 필수적입니다. 자동화된 도구를 사용하면 2 Word docs를 비교하고, 차이점을 강조 표시하며, 삽입, 삭제 또는 수정 사항을 보여주는 포괄적인 보고서를 생성할 수 있습니다. 이는 정확성을 보장하고, 시간을 절약하며, 수동 검토 오류를 피하는 데 도움이 됩니다.
워드 문서 비교를 위한 API
개발자가 C# 애플리케이션에서 Word 파일을 쉽게 비교할 수 있도록 해줍니다. 이 강력한 API는 Word 문서 간의 텍스트, 형식 및 구조적 차이를 식별합니다. NuGet에서 SDK를 설치하세요:
- 단순한 Word 문서뿐만 아니라, API는 다른 여러 형식을 비교할 수 있습니다.
NuGet\Install-Package GroupDocs.Comparison-Cloud -Version 23.10.0
이제 GroupDocs cloud Dashboard에서 클라이언트 ID 및 비밀을 얻으십시오.
C#를 사용하여 Word 문서 비교하기
여기 GroupDocs.Comparison을 사용하여 DOCX 파일을 프로그래밍 방식으로 비교하는 방법이 있습니다:
- API 자격 증명 구성:
var config = new Configuration(clientId, clientSecret);
- CompareApi 초기화:
var compareApi = new CompareApi(config);
- 소스 및 대상 Word 파일 정의:
var sourceFile = new FileInfo("source.docx");
var targetFile = new FileInfo("target.docx");
- 비교 요청 생성:
var request = new ComparisonRequest(sourceFile, targetFile, outputPath);
- 온라인에서 문서를 비교하기 위해 API를 호출하세요:
var response = compareApi.Compare(request);
// 더 많은 예시는 https://github.com/groupdocs-comparison-cloud/groupdocs-comparison-cloud-dotnet 입니다.
var config = new Configuration(clientId, clientSecret);
var compareApi = new CompareApi(config);
var sourceFile = new FileInfo("source.docx");
var targetFile = new FileInfo("target.docx");
var request = new ComparisonRequest(sourceFile, targetFile, outputPath);
var response = compareApi.Compare(request);
DOCX 파일 비교 cURL 사용하기
대안으로, DOCX 파일을 온라인에서 비교할 수 있으며 cURL 명령어를 사용할 수 있습니다. 이는 자동화된 스크립트 및 CI/CD 워크플로우에 유용합니다.
- JWT 토큰 생성:
curl -v "https://api.groupdocs.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=CLIENT_ID&client_secret=CLIENT_SECRET" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
- 문서 비교 수행:
curl -v -X POST "https://api.groupdocs.cloud/v2.0/comparison/comparisons" \
-H "accept: application/json" \
-H "authorization: Bearer {ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-d "{ \"SourceFile\": { \"FilePath\": \"firstDoc.docx\" }, \"TargetFiles\": [ { \"FilePath\": \"secondDoc.docx\" } ], \"Settings\": { \"GenerateSummaryPage\": true, \"ShowDeletedContent\": true, \"ShowInsertedContent\": true, \"StyleChangeDetection\": true, \"InsertedItemsStyle\": { \"Bold\": true, \"Italic\": true, \"StrikeThrough\": true, \"Underline\": true }, \"DeletedItemsStyle\": { \"Bold\": true, \"Italic\": true, \"StrikeThrough\": true, \"Underline\": true }, \"ChangedItemsStyle\": { \"Bold\": true, \"Italic\": true, \"StrikeThrough\": true, \"Underline\": true }, \"WordsSeparatorChars\": [ \"string\" ], \"UseFramesForDelInsElements\": true, \"CalculateComponentCoordinates\": true, \"MarkChangedContent\": true, \"MarkNestedContent\": true, \"MetaData\": { \"Author\": \"Nayyer Shahbaz\", \"LastSaveBy\": \"Nayyer\", \"Company\": \"GroupDocs Cloud\" }, \"DiagramMasterSetting\": { \"UseSourceMaster\": true }, \"OriginalSize\": { \"Width\": 0, \"Height\": 0 }, \"HeaderFootersComparison\": true, \"SensitivityOfComparison\": 0 }, \"OutputPath\": \"comparisonOutput.docx\"}"
무료 온라인 단어 비교 도구 사용해 보기
우리의 무료 Document Comparison 앱을 탐색하여 소프트웨어 설치 없이 온라인에서 두 개의 DOCX 파일 간의 차이점을 확인하세요.

최종 검토
Using GroupDocs.Comparison Cloud SDK for .NET or cURL, you can easily compare 2 documents in Word and highlight differences. Whether you need to compare Word documents for legal, business, or academic use cases, this solution ensures accuracy and efficiency. Instead of relying on manual reviews or limited compare docs in Word features, you can integrate robust document comparison into your applications. This makes it simple to compare Word files, track revisions, and ensure document integrity.