Configuration object containing document sources, UI options, and comparison settings
Promise that resolves to a TextComparisonInstance for programmatic control
const textComparisonInstance = await NutrientViewer.loadTextComparison({
container: '.text-comparison-container',
documentA: 'path/to/document-a.pdf',
documentB: 'path/to/document-b.pdf',
comparisonSidebarConfig: {
diffColors: {
insertionColor: new NutrientViewer.Color({ r: 0, g: 255, b: 0 }),
deletionColor: new NutrientViewer.Color({ r: 255, g: 0, b: 0 })
},
openByDefault: true
}
});
Loads and initializes the Text Comparison UI for comparing two documents.
This method creates a complete text comparison interface with side-by-side document views, highlighting differences between documents, and providing navigation through changes. Optionally supports AI-powered analysis for categorizing and summarizing differences.