This repository contains a React application that demonstrates how to compare two Word documents using the Syncfusion® React DOCX Editor (Document Editor). The sample allows users to upload an original and a revised document, compare them using the Document Editor web service, and view the comparison results with revision tracking.
- Upload an original Word document.
- Upload a revised Word document.
- Compare both documents.
- View tracked revisions in the comparison result.
- Switch between:
- Original vs Compared document
- Original vs Revised document
Before running the sample, ensure the following software is installed:
- Node.js (LTS)
- npm
No additional configuration is required.
This sample is already configured to use the online Syncfusion Document Editor service:
const serviceUrl =
"https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/"; //only for demo purpose.Since the application consumes the hosted web service, you do not need to download, build, or run any ASP.NET Core Web API project.
Open the project folder in a terminal and install the required packages.
npm installStart the React development server.
npm startThe application will launch in your default browser.
If it does not open automatically, browse to:
http://localhost:3000
- Launch the application.
- Click Browse under Original Document and select a DOCX file.
- Click Browse under Revised Document and select another version of the same document.
- Click Compare.
- The application sends both documents to the online Document Editor service.
- The comparison result is displayed in the right-side editor with tracked revisions.
- Toggle between:
- Original vs Compared
- Original vs Revised
- Review insertions, deletions, and formatting changes using the Document Editor revision features.
The application follows the workflow below:
- User uploads the original document.
- User uploads the revised document.
- Both documents are sent to the Syncfusion online Document Editor service.
- The service:
- Imports the DOCX files.
- Compares both documents.
- Generates a document with tracked revisions.
- The comparison result is returned in SFDT format.
- The React application loads the original document in the left editor.
- The compared document (or revised document) is loaded in the right editor for side-by-side review.
Original DOCX
│
│
▼
React Application
│
│
▼
Syncfusion Online Document Editor Service
│
├── Import Original
├── Import Revised
└── Compare Documents
│
▼
Compared SFDT Document
│
▼
React DOCX Editor
│
├── Left Editor → Original
└── Right Editor → Compared / Revised
-
Product page: Syncfusion® React DOCX Editor
-
Documentation: Syncfusion® React DOCX Editor - Documentation
-
Online demo: Syncfusion® React DOCX Editor - Online demo
For any other queries, reach our Syncfusion® support team or post the queries through the community forums.
Request new feature through Syncfusion® feedback portal.
This is a commercial product and requires a paid license for possession or use Syncfusion's licensed software, including this component, is subject to the terms and conditions of Syncfusion's EULA. You can purchase a licnense here or start a free 30-day trial here.
