de.redsix.pdfcompare.PageExclusions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pdfcompare Show documentation
Show all versions of pdfcompare Show documentation
A simple Java library to compare two PDF files. Files are rendered and compared pixel by pixel.
package de.redsix.pdfcompare;
import java.util.ArrayList;
import java.util.Collection;
import java.util.function.Consumer;
public class PageExclusions {
private final Collection exclusions = new ArrayList<>();
private final PageExclusions delegate;
public PageExclusions() {
delegate = null;
}
public PageExclusions(final PageExclusions delegate) {
this.delegate = delegate;
}
public void add(final PageArea exclusion) {
exclusions.add(exclusion);
}
public boolean contains(final int x, final int y) {
for (PageArea exclusion : exclusions) {
if (exclusion.contains(x, y)) {
return true;
}
}
if (delegate != null) {
return delegate.contains(x, y);
}
return false;
}
public void forEach(final Consumer exclusionConsumer) {
exclusions.forEach(exclusionConsumer);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy