Closed rweisleder closed 6 years ago
In which situations would this be useful? Genuine question. The config file makes it much more flexible to define exclusions rather than having it 'hard coded'.
We have a use case where the user wants to compare files from the production system with files from a stage system. So they define some information like
Those data are stored in and read from a file or a database into domain objects. So it would be easier to write (and maintain) method calls against an API instead of depending on a file-based API.
Yes, the current apporach is very flexible. But with the above use case I have to convert my domain object into a config file, call withIgnore(InputStream)
and let pdfcompare parse the file again.
Makes sense... It shouldn't be such a big deal to add such a feature. But I don't have a lot of time for the project at the moment... Maybe you can take a look at the project and see, whether you can create a pull request?
It shouldn't be such a big deal to add such a feature.
I'll work on this one on the next days.
I just took a quick look and added a simple method to do this: new PdfComparator(a, b) .with(new Exclusion(1, 230, 350, 450, 420))
Version 1.1.33 contains the feature and should land in maven central during the next couple of hours.
Currently it is necessary to create a config file to define exclusions. It would be useful to add exclusions directly without a config file.
Example:
Should it be named "withIgnore" or "withExclusion"?