Skip to content

Commit 7817bcb

Browse files
committed
🔖 [RELEASE] Merge branch 'release/1.0.2' into 'master'
DEVSIX-1287, DEVSIX-1289
2 parents 0888928 + 51bf243 commit 7817bcb

File tree

4 files changed

+39
-14
lines changed

4 files changed

+39
-14
lines changed

pom.xml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,34 @@
55
<parent>
66
<groupId>com.itextpdf</groupId>
77
<artifactId>root</artifactId>
8-
<version>7.0.1</version>
8+
<version>7.0.3</version>
99
<relativePath />
1010
</parent>
1111

1212
<artifactId>cleanup</artifactId>
13-
<version>1.0.1</version>
13+
<version>1.0.2</version>
1414
<name>pdfSweep</name>
1515
<url>http://itextpdf.com/</url>
1616

1717
<properties>
18-
<itext.version>7.0.1</itext.version>
18+
<itext.version>${project.parent.version}</itext.version>
1919
</properties>
2020

2121
<dependencies>
2222
<dependency>
2323
<groupId>com.itextpdf</groupId>
2424
<artifactId>io</artifactId>
2525
<version>${itext.version}</version>
26-
<scope>compile</scope>
2726
</dependency>
2827
<dependency>
2928
<groupId>com.itextpdf</groupId>
3029
<artifactId>kernel</artifactId>
3130
<version>${itext.version}</version>
32-
<scope>compile</scope>
3331
</dependency>
3432
<dependency>
3533
<groupId>com.itextpdf</groupId>
3634
<artifactId>layout</artifactId>
3735
<version>${itext.version}</version>
38-
<scope>compile</scope>
3936
</dependency>
4037
<dependency>
4138
<groupId>com.itextpdf</groupId>
@@ -79,18 +76,22 @@
7976
<plugin>
8077
<groupId>org.apache.maven.plugins</groupId>
8178
<artifactId>maven-surefire-plugin</artifactId>
79+
<version>2.19.1</version>
8280
<configuration>
8381
<groups>${unittests}</groups>
82+
<argLine>${env.SUREFIRE_OPTS}</argLine>
8483
</configuration>
8584
</plugin>
8685
<plugin>
8786
<groupId>org.apache.maven.plugins</groupId>
8887
<artifactId>maven-failsafe-plugin</artifactId>
88+
<version>2.19.1</version>
8989
<configuration>
9090
<includes>
9191
<include>**/*Test.java</include>
9292
</includes>
9393
<groups>${integrationtests}</groups>
94+
<argLine>${env.SUREFIRE_OPTS}</argLine>
9495
</configuration>
9596
</plugin>
9697
<plugin>
@@ -103,6 +104,23 @@
103104
</excludes>
104105
</configuration>
105106
</plugin>
107+
<plugin>
108+
<groupId>org.apache.maven.plugins</groupId>
109+
<artifactId>maven-javadoc-plugin</artifactId>
110+
<version>${javadoc.version}</version>
111+
<configuration>
112+
<subpackages>com.itextpdf.pdfcleanup</subpackages>
113+
</configuration>
114+
<executions>
115+
<execution>
116+
<id>attach-javadocs</id>
117+
<phase>package</phase>
118+
<goals>
119+
<goal>jar</goal>
120+
</goals>
121+
</execution>
122+
</executions>
123+
</plugin>
106124
</plugins>
107125
</build>
108126

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ This file is part of the iText (R) project.
5959
import com.itextpdf.kernel.pdf.canvas.CanvasGraphicsState;
6060
import com.itextpdf.kernel.pdf.canvas.CanvasTag;
6161
import com.itextpdf.kernel.pdf.canvas.PdfCanvasConstants;
62+
import com.itextpdf.kernel.pdf.canvas.parser.EventType;
63+
import com.itextpdf.kernel.pdf.canvas.parser.data.IEventData;
6264
import com.itextpdf.kernel.pdf.canvas.parser.data.ImageRenderInfo;
6365
import com.itextpdf.kernel.pdf.canvas.parser.data.PathRenderInfo;
6466
import com.itextpdf.kernel.pdf.canvas.parser.PdfCanvasProcessor;
@@ -247,6 +249,13 @@ protected static Matrix operandsToMatrix(List<PdfObject> operands) {
247249
return new Matrix(a, b, c, d, e, f);
248250
}
249251

252+
@Override
253+
protected void eventOccurred(IEventData data, EventType type) {
254+
if (supportedEvents == null || supportedEvents.contains(type)) {
255+
eventListener.eventOccurred(data, type);
256+
}
257+
}
258+
250259
private void writeGsParamsIfFormXObject(String operator, List<PdfObject> operands) {
251260
if ("Do".equals(operator)) {
252261
PdfStream formStream = getXObjectStream((PdfName) operands.get(0));

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,21 +129,21 @@ public class PdfCleanUpTool {
129129
* Use {@link PdfCleanUpTool#addCleanupLocation(PdfCleanUpLocation)} method
130130
* to set regions to be erased from the document.
131131
*
132-
* @param pdfDocument A{@link com.itextpdf.kernel.pdf.PdfDocument} object representing the document
132+
* @param pdfDocument A {@link PdfDocument} object representing the document
133133
* to which redaction applies.
134134
*/
135135
public PdfCleanUpTool(PdfDocument pdfDocument) {
136136
this(pdfDocument, false);
137137
}
138138

139139
/**
140-
* Creates a {@link PdfCleanUpTool} object. If {@param cleanRedactAnnotations} is true,
140+
* Creates a {@link PdfCleanUpTool} object. If {@code cleanRedactAnnotations} is true,
141141
* regions to be erased are extracted from the redact annotations contained inside the given document.
142-
* Those redact annotations will be removed from the resultant document. If {@param cleanRedactAnnotations} is false,
142+
* Those redact annotations will be removed from the resultant document. If {@code cleanRedactAnnotations} is false,
143143
* then no regions for erasing are specified. In that case use {@link PdfCleanUpTool#addCleanupLocation(PdfCleanUpLocation)}
144144
* method to set regions to be erased from the document.
145145
*
146-
* @param pdfDocument A{@link com.itextpdf.kernel.pdf.PdfDocument} object representing the document
146+
* @param pdfDocument A {@link PdfDocument} object representing the document
147147
* to which redaction applies.
148148
* @param cleanRedactAnnotations if true - regions to be erased are extracted from the redact annotations contained
149149
* inside the given document.
@@ -200,8 +200,8 @@ public PdfCleanUpTool(PdfDocument pdfDocument, boolean cleanRedactAnnotations) {
200200
* Creates a {@link PdfCleanUpTool} object based on the given {@link java.util.List}
201201
* of {@link PdfCleanUpLocation}s representing regions to be erased from the document.
202202
*
203-
* @param cleanUpLocations list of locations to be cleaned up {@see PdfCleanUpLocation}
204-
* @param pdfDocument A{@link com.itextpdf.kernel.pdf.PdfDocument} object representing the document
203+
* @param cleanUpLocations list of locations to be cleaned up {@link PdfCleanUpLocation}
204+
* @param pdfDocument A {@link PdfDocument} object representing the document
205205
* to which redaction applies.
206206
*/
207207
public PdfCleanUpTool(PdfDocument pdfDocument, List<PdfCleanUpLocation> cleanUpLocations) {
@@ -284,8 +284,6 @@ private void addColoredRectangle(PdfCanvas canvas, PdfCleanUpLocation location)
284284
/**
285285
* Adds clean up locations to be erased by extracting regions from the redact annotations
286286
* contained inside the given document. Those redact annotations will be removed from the resultant document.
287-
*
288-
* @return current {@link PdfCleanUpTool} instance.
289287
*/
290288
private void addCleanUpLocationsBasedOnRedactAnnotations() {
291289
redactAnnotations = new LinkedHashMap<>();
36 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)