Skip to content

Commit a3ed23f

Browse files
authored
Text Comparison Example (#166)
1 parent 284a8b9 commit a3ed23f

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import type { TextComparisonConfiguration } from "@nutrient-sdk/viewer";
2+
import { baseOptions } from "../shared/base-options";
3+
4+
window.NutrientViewer.loadTextComparison({
5+
...baseOptions,
6+
theme: window.NutrientViewer.Theme.DARK,
7+
documentA:
8+
"https://public-solutions-engineering-bucket.s3.eu-central-1.amazonaws.com/docs/text-comparison-a.pdf",
9+
documentB:
10+
"https://public-solutions-engineering-bucket.s3.eu-central-1.amazonaws.com/docs/text-comparison-b.pdf",
11+
toolbarItems: [
12+
{ type: "prev-change" },
13+
{ type: "next-change" },
14+
{ type: "comparison-changes" },
15+
{ type: "scroll-lock" },
16+
],
17+
comparisonSidebarConfig: {
18+
diffColors: {
19+
deletionColor: new window.NutrientViewer.Color({
20+
r: 255,
21+
g: 218,
22+
b: 185,
23+
}),
24+
insertionColor: new window.NutrientViewer.Color({
25+
r: 200,
26+
g: 255,
27+
b: 200,
28+
}),
29+
},
30+
},
31+
} as TextComparisonConfiguration).then((instance) => {
32+
console.log("Text comparison loaded successfully", instance);
33+
});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
category: comparison
3+
title: Text Comparison
4+
description: Compare two PDF documents side-by-side with customized highlight colors for insertions and deletions.
5+
keywords: [text comparison, loadTextComparison, diff colors, document comparison, navigation, sidebar]
6+
---

0 commit comments

Comments
 (0)