Comparing PDF documents
can be difficult: very different files can produce visually identical documents.
Jannock is a Java library that aims to make this task easier. It is mainly
intended to be used in tests for methods that generate PDF documents.
Jannock is able to ignore:
- document creation dates,
- the reorganization of the internal structure of the document.
Jannock requires Java 8 or later.
The source code for the Java implementation of this library is available for download.
The artifacts used by the project are available in the Central Maven repository. The library is not yet available in the central repository. Nonetheless, the recommended coordinates for the current version are:
<dependency>
<groupId>com.sinefine.utils</groupId>
<artifactId>jannock</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
Assuming Maven 3 and Git 2 are installed and are on the operating system's path then the following commands can be used to download and build the application:
host$ git clone https://github.com/FeetInAncientTime/jannock.git
host$ cd jannock
host$ mvn install
Jannock is intended to be used in unit tests. A simple, but incomplete example for JUnit is shown below:
import static org.junit.Assert.assertTrue;
public class FooTest {
public void testBar() {
final byte[] actual = ...
final byte[] expected = ...
assertTrue("The test PDF files do not match!",
Pdfs.areEqual(actual,expected));
}
}
TODO...
Further documentation is available at the project's homepage.
Jannock is licensed under the Apache License, Version 2.0.
For additional information, see the LICENSE.