Merge branch 'RED-8385' into 'master'

RED-8385: add functionality to ignore specific marked contents

Closes RED-8385

See merge request redactmanager/commons/pdftron-logic-commons!22
This commit is contained in:
Kilian Schüttler 2024-02-01 12:26:06 +01:00
commit 3bbd13daca

View File

@ -37,6 +37,7 @@ import lombok.extern.slf4j.Slf4j;
public class InvisibleElementRemovalService {
static public final double TOLERANCE = 1;
public static final String KNECON_OCR = "KNECON_OCR";
/**
@ -86,12 +87,22 @@ public class InvisibleElementRemovalService {
}
/**
* This method is equal to {@link #removeInvisibleElements(InputStream, OutputStream, boolean, boolean, Set)}, with removePaths == true and markedContentsToIgnore = Set.of("KNECON_OCR").
*/
public void removeInvisibleElementsButKeepOcrText(InputStream pdfFile, OutputStream out, boolean delta) {
removeInvisibleElements(pdfFile, out, delta, true, Set.of("KNECON_OCR"));
removeInvisibleElements(pdfFile, out, delta, true, Set.of(KNECON_OCR));
}
/**
* This method is equal to {@link #removeInvisibleElements(InputStream, OutputStream, boolean, boolean, Set)}, with removePaths == true and markedContentsToIgnore = Set.of("KNECON_OCR").
*/
public void removeInvisibleElementsButKeepOcrText(PDFDoc pdfFile, boolean delta) {
removeInvisibleElements(pdfFile, delta, true, Set.of(KNECON_OCR));
}