red6 / pdfcompare

A simple Java library to compare two PDF files
Apache License 2.0
220 stars 66 forks source link

Add API method to set the allowed difference #32

Closed rweisleder closed 5 years ago

rweisleder commented 6 years ago

In a single run I want to compare multiple PDF files. Each file has a different "allowed difference". Currently it is only possible to set a global "allowed difference" via the application.conf. It should be possible to configure it per run.

Ebsy commented 6 years ago

I agree on this one. It'd be useful to define a difference tolerance per run.

hsoehalim commented 5 years ago

I'm curious, how do we create Environment obj. There's no default public constructor for this class (it's set to private). Are we suppose to provide our own implementation of Environment class?

Thanks, Harry

rweisleder commented 5 years ago

Currently, there is no possibility to create an Environment object. It's only possible to configure the Environment with a config file.

With my proposed PR the Environment is an interface. There are possibilities to use the "old" default with a config file, provide a configuration with a POJO, or provide a custom implementation of this interface.

danile42 commented 5 years ago

That's a cool feature! I'll try to create a PR to have it in the main documentation page.