Java Compare two PDFs gives scrambled report


#1

I am using a trial license for compare for java 18.6 and I have turned on summary report and style change detection in the settings. I am using 2 PDFs with a small number of changes between them. It seems to overlay the two documents with different margins, tags a bunch of deletes and one insert with 26 changes. Nothing is highlighted blue or green for the insert and changes. The footer is up in the address block and the header is on page 2. I have attached a zip file with the two files compared and the report.

Here is the code I used:
private static void compareFiles(String file1, String file2, String reportPath)
{
ComparisonSettings settings = null;
Comparer comparer = null;
ICompareResult result = null;
String suffix = null;

	try
	{
		comparer = new Comparer();
		settings = new ComparisonSettings();
		settings.setGenerateSummaryPage(true);
		settings.setStyleChangeDetection(true);
		
		suffix = file1.substring(file1.lastIndexOf("."));
		if(!suffix.startsWith("."))
		{
			suffix = "." + suffix;
		}

		result = comparer.compare(new FileInputStream(file1), new FileInputStream(file2), settings);
		result.saveDocument(reportPath + suffix);
		
		System.out.println("Finished compare " + result.getChanges().length + " changes.");
		System.out.println("Report written to " + reportPath + suffix);
	}
	catch(Exception e)
	{
		e.printStackTrace();
	}
}

ScrambledReport.zip (254.8 KB)


#2

@sherter,

We are further investigating this issue. Your issue ID is COMPARISONJAVA-426. As we have further updates on it, we shall inform you. Your patience shall be appreciated in this regard.


#3

@sherter,

Your reported issue is resolved in latest release of the API. Please integrate 18.6.1 in your project.


#4

With the 18.6.1 the report is no longer scrambled.


#5

@sherter,

Glad to know that your issue is now resolved.