I am having an issue when comparing 2 PDF’s with Aspose.Words. When calling the .Compare() method, our code will create a “diff” PDF if the PDF’s are not equal. I am seeing an issue where the 2 PDF’s compared look identical to the human eye, but the .Compare() method will fail with 80 + revisions, and create an output (diff) PDF. The issue is that this output diff PDF created by Aspose does not show any differences (no red strike outs), and is rendered much differently than either of the 2 compared PDF’s. Can someone help with this issue? We have a Aspose.Total license.I cannot upload the PDF’s to this post as they have PHI.
Here is the code for reference:
SetAsposeLicense();
Document baselineDoc = new Document(baselinePdfPath);
Document generatedDoc = new Document(generatedPdfPath);
// There should be no revisions before comparison
baselineDoc.AcceptAllRevisions();
generatedDoc.AcceptAllRevisions();
baselineDoc.Compare(generatedDoc, "Reports PDF Comparison", DateTime.Now);
if (baselineDoc.Revisions.Count.Equals(0))
{
logger.Debug("Both PDF's matches");
return true;
}
else
{
string filePath = Path.Combine(outputFilePath, string.Concat(outputFileName, ".pdf"));
baselineDoc.Save(filePath);
logger.Debug($"There is a mismatch between the PDF's, the differences is saved in the file - {filePath}");
return false;
}