Skip to content

TextControl/TXTextControl.TrackChanges.Review

Repository files navigation

TX Text Control Track Changes Review Sample

This sample demonstrates how to build a document review workflow for .docx files with tracked changes using TX Text Control .NET Server and ASP.NET Core.

Why tracked changes matter

Tracked changes are essential in industries where edits must be auditable, attributable, and reviewable:

  • Legal: contract negotiations require clear redlines, author attribution, and formal accept/reject decisions.
  • Healthcare: policy/procedure updates and clinical document revisions need transparent review history.
  • Finance & Insurance: compliance-driven documents require controlled edit trails and approval workflows.
  • Public Sector: regulated document updates must preserve accountability and revision context.

This sample focuses on making that review process usable and efficient.

What this sample does

1) Document dashboard

The home page scans the Documents folder for .docx files and lists documents that contain tracked changes.

For each document it shows:

  • file name
  • unique authors (comma-separated)
  • latest change timestamp (relative + exact)
  • number of tracked changes

2) Review page

For a selected document, the review page provides:

  • sortable/filterable table of changes
  • pagination with selectable page size (10, 20, 50, 100)
  • single-change actions: Accept / Reject
  • bulk actions with checkboxes: Accept Selected / Reject Selected
  • row count and paging status

3) SVG preview pane

Each change can be previewed in a right-side panel:

  • focused SVG snippet around the change
  • full-page SVG modal

4) Author activity heatmap

A GitHub-style heatmap visualizes author activity over time:

  • activity intensity by date and author
  • legend from low to high activity
  • winner icon for most active author(s)

How TX Text Control is used

The sample uses ServerTextControl to process Word documents server-side:

  • Load Word documents
    • textControl.Load(filePath, StreamType.WordprocessingML)
  • Read tracked changes
    • iterate textControl.TrackedChanges
    • read metadata such as Number, UserName, ChangeKind, Text, ChangeTime, Start, Length
  • Apply decisions (accept/reject)
    • textControl.TrackedChanges.Remove(trackedChange, acceptChanges)
    • save back to .docx with textControl.Save(...)
  • Create visual previews
    • determine page/line via InputPosition
    • generate page SVG via GetPages()[pageNumber].GetImage(...)
    • crop SVG viewbox for focused preview

This provides a complete edit-review loop while keeping native Word compatibility.

Project structure (high level)

  • Controllers/HomeController.cs
    Loads documents, serves review data, applies change decisions, and returns preview payloads.

  • Views/Home/Index.cshtml
    Dashboard listing documents with tracked changes.

  • Views/Home/Review.cshtml
    Main review UI: heatmap, table, filtering, sorting, paging, bulk actions, preview UI.

  • wwwroot/js/review.js
    Client-side behavior for filtering, sorting, paging, selection, bulk submit, and preview loading.

  • wwwroot/css/site.css
    Styling for dashboard/review layout, heatmap, and table interactions.

  • Models/*
    View models and shared display helpers (for example relative timestamp formatting).

Running the sample

  1. Place .docx files with tracked changes in the Documents folder.
  2. Build and run the ASP.NET Core project.
  3. Open the dashboard, choose a document, and review/apply changes.

Notes

  • The sample is designed for review workflows; adapt persistence/audit logging as needed for production.
  • For regulated environments, add authentication/authorization and immutable audit records for decisions.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors