[Defect] - Data validations in the resulting DOCX and PDF after comparison

Steps to reproduce:

Scenario 1:

  1. Compare attached docx files (APA-Table-of-Contents-TemplateLab.com_.docx, APA-Table-of-Contents-TemplateLab.com_v2.docx) and validate PDF.

Actual:- attached content is missing in PDF (Missing_content.pdf)
APA-Table-of-Contents-TemplateLab.com_.docx (71.8 KB)

APA-Table-of-Contents-TemplateLab.com_v2.docx (80.2 KB)

APA-Table-of-Contents-TemplateLab.com__APA-Table-of-Contents-TemplateLab.com_v2_fbed6273-6b4e-4a9a-bf69-7af65bbd1c79.pdf (60.1 KB)

@abhishek.sonkar Unfortunately, it is not quite clear what you mean. Could you please elaborate the problem in more details. As I can see the comparison result produced by Aspose.Words is similar to comparison result produced by MS Word.

HI @alexey.noskov
If you open the APA-Table-of-Contents-TemplateLab.com__APA-Table-of-Contents-TemplateLab.com_v2_fbed6273-6b4e-4a9a-bf69-7af65bbd1c79.pdf (60.1 KB) you will find “…” is missing in PDF file , I checked with MS-doc comparison it is present there but it is missing here in result file.

for example please find snippet of example below.
Missing_content (2).pdf (12.1 KB)

	private void compareDocuments(Document original, Document revised, ComparisonRequest comparisonRequest)
			throws Exception {

		if (original.hasRevisions())
			original.acceptAllRevisions();
		if (revised.hasRevisions())
			revised.acceptAllRevisions();
		original.compare(revised, "Author", new java.util.Date());
		// Save the comparison result
		updateRevisionProperties(original);
		original.save(
				comparisonRequest.getOutputFileDirectory() + File.separator + comparisonRequest.getOutputFileName());
		PdfSaveOptions saveOptions = new PdfSaveOptions();
		// for accessibility
		saveOptions.setCompliance(PdfCompliance.PDF_UA_1);
		original.save(comparisonRequest.getOutputPDFFileDirectory() + File.separator
				+ comparisonRequest.getOutputPDFFileName(), saveOptions);
	}

@abhishek.sonkar Unfortunately, I cannot reproduce the problem on my side here are PDF outputs produced by the following code on my side and using MS Word:

Document v1 = new Document("C:\\Temp\\v1.docx");
Document v2 = new Document("C:\\Temp\\v2.docx");
    
v1.acceptAllRevisions();
v2.acceptAllRevisions();
    
v1.compare(v2, "AW", new Date());
v1.save("C:\\Temp\\out.pdf");

ms.pdf (421.0 KB)
out.pdf (105.8 KB)

As I can see in your code you are configuring revision appearance using updateRevisionProperties. This method is not provided. Could you please provide it for testing. Most likely there is something in this method.

private void updateRevisionProperties(Document document) {
    RevisionOptions revisionOptions = document.getLayoutOptions().getRevisionOptions();
    // Color for insertions
    revisionOptions.setInsertedTextColor(RevisionColor.BRIGHT_GREEN);
    // Color for deletions
    revisionOptions.setDeletedTextColor(RevisionColor.RED);
    revisionOptions.setRevisedPropertiesColor(RevisionColor.TURQUOISE);
    revisionOptions.setRevisedPropertiesEffect(RevisionTextEffect.COLOR);
    revisionOptions.setRevisionBarsColor(RevisionColor.RED);
    revisionOptions.setRevisionBarsWidth(2);
}

Please find another method implementation

@abhishek.sonkar The problem is still not reproducible on my side. Here is the output produced with the above provided method:
out.pdf (105.8 KB)

do we have to install any other library for this ? I am suspecting if any extra library for fonts or so is needed for this.

@abhishek.sonkar As I can see you output PDF uses DejaVuSans font. The problem occurs because the fonts used in the document are not avaialble in the environment where document is converted to PDF. If Aspose.Words cannot find the fonts used in the document the fonts are substituted. This might lead into the layout differences due to differences in fonts metrics. You can implement IWarningCallback to get a notification when font substitution is performed.
The following articles can be useful for you:
https://docs.aspose.com/words/java/specify-truetype-fonts-location/
https://docs.aspose.com/words/java/install-truetype-fonts-on-linux/