Skip to content

Commit 97729a1

Browse files
committed
[RELEASE] iText pdfSweep 4.0.2
2 parents 6ce10e6 + 094d013 commit 97729a1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+75
-56
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
<parent>
66
<groupId>com.itextpdf</groupId>
77
<artifactId>root</artifactId>
8-
<version>8.0.2</version>
8+
<version>8.0.3</version>
99
<relativePath />
1010
</parent>
1111

1212
<artifactId>cleanup</artifactId>
13-
<version>4.0.1</version>
13+
<version>4.0.2</version>
1414

1515
<name>pdfSweep</name>
1616
<description>Redact PDF documents. If you have to share PDFs with different departments or send them out of house, but they

src/main/java/com/itextpdf/pdfcleanup/CleanUpProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/main/java/com/itextpdf/pdfcleanup/FilteredImagesCache.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/main/java/com/itextpdf/pdfcleanup/LineDashPattern.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/main/java/com/itextpdf/pdfcleanup/PdfCleanUpEventListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/main/java/com/itextpdf/pdfcleanup/PdfCleanUpFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/main/java/com/itextpdf/pdfcleanup/PdfCleanUpLocation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/main/java/com/itextpdf/pdfcleanup/PdfCleanUpProcessor.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.
@@ -675,15 +675,15 @@ private PdfImageXObject getFilteredImage(FilteredImagesCache.FilteredImageKey fi
675675
PdfCleanUpFilter.FilterResult<ImageData> imageFilterResult = filter.filterImage(filteredImageKey);
676676
if (imageFilterResult.isModified()) {
677677
ImageData filteredImageData = imageFilterResult.getFilterResult();
678-
if (Boolean.TRUE.equals(originalImage.getPdfObject().getAsBool(PdfName.ImageMask))) {
679-
if (!PdfCleanUpFilter.imageSupportsDirectCleanup(originalImage)) {
680-
Logger logger = LoggerFactory.getLogger(PdfCleanUpProcessor.class);
681-
logger.error(CleanUpLogMessageConstant.IMAGE_MASK_CLEAN_UP_NOT_SUPPORTED);
682-
} else {
683-
filteredImageData.makeMask();
684-
}
685-
}
686678
if (filteredImageData != null) {
679+
if (Boolean.TRUE.equals(originalImage.getPdfObject().getAsBool(PdfName.ImageMask))) {
680+
if (!PdfCleanUpFilter.imageSupportsDirectCleanup(originalImage)) {
681+
Logger logger = LoggerFactory.getLogger(PdfCleanUpProcessor.class);
682+
logger.error(CleanUpLogMessageConstant.IMAGE_MASK_CLEAN_UP_NOT_SUPPORTED);
683+
} else {
684+
filteredImageData.makeMask();
685+
}
686+
}
687687
imageToWrite = new PdfImageXObject(filteredImageData);
688688
getFilteredImagesCache().put(filteredImageKey, imageToWrite);
689689

src/main/java/com/itextpdf/pdfcleanup/PdfCleanUpTool.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/main/java/com/itextpdf/pdfcleanup/PdfCleaner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/main/java/com/itextpdf/pdfcleanup/TextPositioning.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/main/java/com/itextpdf/pdfcleanup/actions/data/PdfSweepProductData.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.
@@ -31,9 +31,9 @@ public class PdfSweepProductData {
3131
public static final String PDF_SWEEP_PRODUCT_NAME = "pdfSweep";
3232
public static final String PDF_SWEEP_PUBLIC_PRODUCT_NAME = PDF_SWEEP_PRODUCT_NAME;
3333

34-
private static final String PDF_SWEEP_VERSION = "4.0.1";
34+
private static final String PDF_SWEEP_VERSION = "4.0.2";
3535
private static final int PDF_SWEEP_COPYRIGHT_SINCE = 2000;
36-
private static final int PDF_SWEEP_COPYRIGHT_TO = 2023;
36+
private static final int PDF_SWEEP_COPYRIGHT_TO = 2024;
3737

3838
private static final ProductData PDF_SWEEP_PRODUCT_DATA = new ProductData(PDF_SWEEP_PUBLIC_PRODUCT_NAME,
3939
PDF_SWEEP_PRODUCT_NAME, PDF_SWEEP_VERSION, PDF_SWEEP_COPYRIGHT_SINCE, PDF_SWEEP_COPYRIGHT_TO);

src/main/java/com/itextpdf/pdfcleanup/actions/event/PdfSweepProductEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/main/java/com/itextpdf/pdfcleanup/autosweep/CommonRegex.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/main/java/com/itextpdf/pdfcleanup/autosweep/CompositeCleanupStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/main/java/com/itextpdf/pdfcleanup/autosweep/ICleanupStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/main/java/com/itextpdf/pdfcleanup/autosweep/PdfAutoSweepTools.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/main/java/com/itextpdf/pdfcleanup/autosweep/RegexBasedCleanupStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/main/java/com/itextpdf/pdfcleanup/exceptions/CleanupExceptionMessageConstant.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/main/java/com/itextpdf/pdfcleanup/logs/CleanUpLogMessageConstant.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/main/java/com/itextpdf/pdfcleanup/util/CleanUpCsCompareUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/main/java/com/itextpdf/pdfcleanup/util/CleanUpHelperUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/main/java/com/itextpdf/pdfcleanup/util/CleanUpImageUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/test/java/com/itextpdf/pdfcleanup/BigDocumentAutoCleanUpTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/test/java/com/itextpdf/pdfcleanup/BigDocumentCleanUpTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/test/java/com/itextpdf/pdfcleanup/CleanUpAnnotationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/test/java/com/itextpdf/pdfcleanup/CleanUpCsCompareUtilTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/test/java/com/itextpdf/pdfcleanup/CleanUpImageUtilTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/test/java/com/itextpdf/pdfcleanup/CleanUpInvalidPdfTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/test/java/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/test/java/com/itextpdf/pdfcleanup/CleanupLicenseEventsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/test/java/com/itextpdf/pdfcleanup/FilteredImagesCacheTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/test/java/com/itextpdf/pdfcleanup/PdfAutoSweepToolsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/test/java/com/itextpdf/pdfcleanup/PdfCleanUpFilterUnitTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/test/java/com/itextpdf/pdfcleanup/PdfCleanUpProcessorUnitTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/test/java/com/itextpdf/pdfcleanup/PdfCleanUpToolTest.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.
@@ -1063,6 +1063,25 @@ public void checkUnSupportedImageTypeTest() throws IOException {
10631063
pdfDocument.close();
10641064
}
10651065

1066+
@Test
1067+
public void cleanUpFullyFilteredImageTest() throws IOException, InterruptedException {
1068+
String input = INPUT_PATH + "fullyFilteredImageDocument.pdf";
1069+
String output = OUTPUT_PATH + "fullyFilteredImageDocument.pdf";
1070+
String cmp = INPUT_PATH + "cmp_fullyFilteredImageDocument.pdf";
1071+
1072+
PdfDocument pdfDocument = new PdfDocument(new PdfReader(input), new PdfWriter(output, new WriterProperties()));
1073+
PdfCleanUpTool workingTool = new PdfCleanUpTool(pdfDocument);
1074+
int pageIndex = 1;
1075+
Rectangle area = pdfDocument.getPage(pageIndex).getPageSize();
1076+
workingTool.addCleanupLocation(new PdfCleanUpLocation(pageIndex, area));
1077+
1078+
workingTool.cleanUp();
1079+
1080+
pdfDocument.close();
1081+
1082+
compareByContent(cmp, output, OUTPUT_PATH, "diff_fullyFilteredImageDocument_");
1083+
}
1084+
10661085
private void cleanUp(String input, String output, List<PdfCleanUpLocation> cleanUpLocations) throws IOException {
10671086
PdfDocument pdfDocument = new PdfDocument(new PdfReader(input), new PdfWriter(output));
10681087

src/test/java/com/itextpdf/pdfcleanup/PdfCleanUpToolWithInlineImagesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/test/java/com/itextpdf/pdfcleanup/RectangleTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/test/java/com/itextpdf/pdfcleanup/TextPositioningTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/test/java/com/itextpdf/pdfcleanup/images/CleanUpImageIndexedColorSpaceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

src/test/java/com/itextpdf/pdfcleanup/images/CleanUpTransformedImageTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 Apryse Group NV
3+
Copyright (c) 1998-2024 Apryse Group NV
44
Authors: Apryse Software.
55
66
This program is offered under a commercial and under the AGPL license.

0 commit comments

Comments
 (0)