From 58343a49d3e44583dddfcb961d7977b88ea4cb06 Mon Sep 17 00:00:00 2001 From: RaphaelArnold Date: Thu, 3 Aug 2023 11:34:51 +0200 Subject: [PATCH] RED-7075: WatermarkRemoval with javadoc comment --- .../red/pdftronlogic/commons/WatermarkRemovalService.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/iqser/red/pdftronlogic/commons/WatermarkRemovalService.java b/src/main/java/com/iqser/red/pdftronlogic/commons/WatermarkRemovalService.java index e1fb30e..85d618c 100644 --- a/src/main/java/com/iqser/red/pdftronlogic/commons/WatermarkRemovalService.java +++ b/src/main/java/com/iqser/red/pdftronlogic/commons/WatermarkRemovalService.java @@ -33,6 +33,14 @@ public class WatermarkRemovalService { final static int MIN_PAGES_THRESHOLD = 3; + /** + * The method remove watermark works only for Documents with size greater than MIN_PAGES_THRESHOLD. + * First the possible watermarks (big XObjects or Images) will be detected and then checked if those appear on most pages according to the + * OCCURING_ON_PAGES_THRESHOLD_FACTOR by using image hashing for similarity and size and stream size of the xobjects. + * If so, these detected and confirmed will not be written to the pdf file. + * @param pdfFile PDFFile to remove watermarks + * @param out The OutputStream the final file will be written to + */ @SneakyThrows public void removeWatermarks(InputStream pdfFile, OutputStream out) {