While comparing two word documents using Aspose.Words, there are multiple alignment issues and word overlapping’s in the compare report.
Below is the code snippet used in Dot Net Core:
static void Main(string[] args)
{
// Set the license for Aspose.Words
new License().SetLicense("C:\\Project Area\\Feasibility\\AsposeCompare\\AsposeCompare\\License.lic");
// Load the PDF documents
var fileStream1 = new FileStream("C:\\Project Area\\Feasibility\\AsposeCompare\\Compare1.docx", new FileStreamOptions { Options = FileOptions.Encrypted });
var fileStream2 = new FileStream("C:\\Project Area\\Feasibility\\AsposeCompare\\Compare2.docx", new FileStreamOptions { Options = FileOptions.Encrypted });
Document docA = new Document(fileStream1);
Document docB = new Document(fileStream2);
// Set up the comparison options
CompareOptions options = new CompareOptions();
options.Target = ComparisonTargetType.New;
// Perform the comparison
docA.Compare(docB, "Author", DateTime.Now, options);
// Save the comparison result
docA.Save("C:\\Project Area\\Feasibility\\AsposeCompare\\Comparison_Output.pdf");
Console.WriteLine("Done");
}
Please check the below screenshots for reference for alignment issues and words overlapping: