Skip to content

Commit b7ca1dd

Browse files
committed
[RELEASE] iText 7 pdfSweep 4.0.0
2 parents f26e8b5 + 33b3fdb commit b7ca1dd

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

+562
-1158
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Contributing to iText 7 Community
1+
# Contributing to iText Community
22

3-
We'd love for you to contribute to our source code and to make **iText 7 Community** even better than it is
3+
We'd love for you to contribute to our source code and to make **iText Community** even better than it is
44
today! Here are the guidelines we'd like you to follow:
55

66
- [Question or Problem?](#question)
@@ -15,7 +15,7 @@ today! Here are the guidelines we'd like you to follow:
1515

1616
## <a name="question">Got a Question or Problem?</a>
1717

18-
If you have questions about how to use **iText 7 Community**, please direct these to [Stack Overflow][stackoverflow].
18+
If you have questions about how to use **iText Community**, please direct these to [Stack Overflow][stackoverflow].
1919

2020
If you are a customer with a [support agreement][support], you also have direct access to our JIRA and our developers.
2121

@@ -79,7 +79,7 @@ Before you submit your pull request consider the following guidelines:
7979
* Build your changes locally to ensure all the tests pass.
8080
* Push your changes to your GitHub account.
8181
* Create a pull request in GitHub.
82-
"Head fork" should be your repository, and the "base fork" should be the iText7 official repository.
82+
"Head fork" should be your repository, and the "base fork" should be the iText official repository.
8383
* If we suggest changes then:
8484
* Make the required updates.
8585
* Fix up your commits if needed, with an interactive rebase.
@@ -111,7 +111,7 @@ To ensure consistency throughout the source code, keep these rules in mind as yo
111111

112112
We have guidelines on how our git commit messages should be formatted. This leads to **more
113113
readable messages** that are easy to follow when looking through the **project history**. But also,
114-
we use the git commit messages to **generate the iText 7 Community change log**.
114+
we use the git commit messages to **generate the iText Community change log**.
115115

116116
These guidelines were taken from Chris Beams' blog post [How to Write a Git Commit Message][git-commit].
117117

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
**[pdfSweep][pdfSweep]** is an [iText 7][itext] add on.
1+
**[pdfSweep][pdfSweep]** is an [iText][itext] add on.
22

33
This add on will allow you to easily redact PDF files. Redaction is the process of removing sensitive or confidential information. pdfSweep will remove this data entirely so that it won't be extractable anymore.
44

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>7.2.5</version>
8+
<version>8.0.0</version>
99
<relativePath />
1010
</parent>
1111

1212
<artifactId>cleanup</artifactId>
13-
<version>3.0.2</version>
13+
<version>4.0.0</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: 15 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,24 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 iText Group NV
4-
Authors: iText Software.
3+
Copyright (c) 1998-2023 Apryse Group NV
4+
Authors: Apryse Software.
55
6-
This program is free software; you can redistribute it and/or modify
7-
it under the terms of the GNU Affero General Public License version 3
8-
as published by the Free Software Foundation with the addition of the
9-
following permission added to Section 15 as permitted in Section 7(a):
10-
FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY
11-
ITEXT GROUP. ITEXT GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT
12-
OF THIRD PARTY RIGHTS
6+
This program is offered under a commercial and under the AGPL license.
7+
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
138
14-
This program is distributed in the hope that it will be useful, but
15-
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16-
or FITNESS FOR A PARTICULAR PURPOSE.
17-
See the GNU Affero General Public License for more details.
18-
You should have received a copy of the GNU Affero General Public License
19-
along with this program; if not, see http://www.gnu.org/licenses or write to
20-
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21-
Boston, MA, 02110-1301 USA, or download the license from the following URL:
22-
http://itextpdf.com/terms-of-use/
23-
24-
The interactive user interfaces in modified source and object code versions
25-
of this program must display Appropriate Legal Notices, as required under
26-
Section 5 of the GNU Affero General Public License.
9+
AGPL licensing:
10+
This program is free software: you can redistribute it and/or modify
11+
it under the terms of the GNU Affero General Public License as published by
12+
the Free Software Foundation, either version 3 of the License, or
13+
(at your option) any later version.
2714
28-
In accordance with Section 7(b) of the GNU Affero General Public License,
29-
a covered work must retain the producer line in every PDF that is created
30-
or manipulated using iText.
15+
This program is distributed in the hope that it will be useful,
16+
but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
GNU Affero General Public License for more details.
3119
32-
You can be released from the requirements of the license by purchasing
33-
a commercial license. Buying such a license is mandatory as soon as you
34-
develop commercial activities involving the iText software without
35-
disclosing the source code of your own applications.
36-
These activities include: offering paid services to customers as an ASP,
37-
serving PDFs on the fly in a web application, shipping iText with a closed
38-
source product.
39-
40-
For more information, please contact iText Software Corp. at this
41-
20+
You should have received a copy of the GNU Affero General Public License
21+
along with this program. If not, see <https://www.gnu.org/licenses/>.
4222
*/
4323
package com.itextpdf.pdfcleanup;
4424

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

Lines changed: 18 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,24 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 iText Group NV
4-
Authors: iText Software.
5-
6-
This program is free software; you can redistribute it and/or modify
7-
it under the terms of the GNU Affero General Public License version 3
8-
as published by the Free Software Foundation with the addition of the
9-
following permission added to Section 15 as permitted in Section 7(a):
10-
FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY
11-
ITEXT GROUP. ITEXT GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT
12-
OF THIRD PARTY RIGHTS
13-
14-
This program is distributed in the hope that it will be useful, but
15-
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16-
or FITNESS FOR A PARTICULAR PURPOSE.
17-
See the GNU Affero General Public License for more details.
3+
Copyright (c) 1998-2023 Apryse Group NV
4+
Authors: Apryse Software.
5+
6+
This program is offered under a commercial and under the AGPL license.
7+
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
8+
9+
AGPL licensing:
10+
This program is free software: you can redistribute it and/or modify
11+
it under the terms of the GNU Affero General Public License as published by
12+
the Free Software Foundation, either version 3 of the License, or
13+
(at your option) any later version.
14+
15+
This program is distributed in the hope that it will be useful,
16+
but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
GNU Affero General Public License for more details.
19+
1820
You should have received a copy of the GNU Affero General Public License
19-
along with this program; if not, see http://www.gnu.org/licenses or write to
20-
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21-
Boston, MA, 02110-1301 USA, or download the license from the following URL:
22-
http://itextpdf.com/terms-of-use/
23-
24-
The interactive user interfaces in modified source and object code versions
25-
of this program must display Appropriate Legal Notices, as required under
26-
Section 5 of the GNU Affero General Public License.
27-
28-
In accordance with Section 7(b) of the GNU Affero General Public License,
29-
a covered work must retain the producer line in every PDF that is created
30-
or manipulated using iText.
31-
32-
You can be released from the requirements of the license by purchasing
33-
a commercial license. Buying such a license is mandatory as soon as you
34-
develop commercial activities involving the iText software without
35-
disclosing the source code of your own applications.
36-
These activities include: offering paid services to customers as an ASP,
37-
serving PDFs on the fly in a web application, shipping iText with a closed
38-
source product.
39-
40-
For more information, please contact iText Software Corp. at this
41-
21+
along with this program. If not, see <https://www.gnu.org/licenses/>.
4222
*/
4323
package com.itextpdf.pdfcleanup;
4424

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

Lines changed: 18 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,24 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 iText Group NV
4-
Authors: iText Software.
5-
6-
This program is free software; you can redistribute it and/or modify
7-
it under the terms of the GNU Affero General Public License version 3
8-
as published by the Free Software Foundation with the addition of the
9-
following permission added to Section 15 as permitted in Section 7(a):
10-
FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY
11-
ITEXT GROUP. ITEXT GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT
12-
OF THIRD PARTY RIGHTS
13-
14-
This program is distributed in the hope that it will be useful, but
15-
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16-
or FITNESS FOR A PARTICULAR PURPOSE.
17-
See the GNU Affero General Public License for more details.
3+
Copyright (c) 1998-2023 Apryse Group NV
4+
Authors: Apryse Software.
5+
6+
This program is offered under a commercial and under the AGPL license.
7+
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
8+
9+
AGPL licensing:
10+
This program is free software: you can redistribute it and/or modify
11+
it under the terms of the GNU Affero General Public License as published by
12+
the Free Software Foundation, either version 3 of the License, or
13+
(at your option) any later version.
14+
15+
This program is distributed in the hope that it will be useful,
16+
but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
GNU Affero General Public License for more details.
19+
1820
You should have received a copy of the GNU Affero General Public License
19-
along with this program; if not, see http://www.gnu.org/licenses or write to
20-
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21-
Boston, MA, 02110-1301 USA, or download the license from the following URL:
22-
http://itextpdf.com/terms-of-use/
23-
24-
The interactive user interfaces in modified source and object code versions
25-
of this program must display Appropriate Legal Notices, as required under
26-
Section 5 of the GNU Affero General Public License.
27-
28-
In accordance with Section 7(b) of the GNU Affero General Public License,
29-
a covered work must retain the producer line in every PDF that is created
30-
or manipulated using iText.
31-
32-
You can be released from the requirements of the license by purchasing
33-
a commercial license. Buying such a license is mandatory as soon as you
34-
develop commercial activities involving the iText software without
35-
disclosing the source code of your own applications.
36-
These activities include: offering paid services to customers as an ASP,
37-
serving PDFs on the fly in a web application, shipping iText with a closed
38-
source product.
39-
40-
For more information, please contact iText Software Corp. at this
41-
21+
along with this program. If not, see <https://www.gnu.org/licenses/>.
4222
*/
4323
package com.itextpdf.pdfcleanup;
4424

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

Lines changed: 18 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,24 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 iText Group NV
4-
Authors: iText Software.
5-
6-
This program is free software; you can redistribute it and/or modify
7-
it under the terms of the GNU Affero General Public License version 3
8-
as published by the Free Software Foundation with the addition of the
9-
following permission added to Section 15 as permitted in Section 7(a):
10-
FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY
11-
ITEXT GROUP. ITEXT GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT
12-
OF THIRD PARTY RIGHTS
13-
14-
This program is distributed in the hope that it will be useful, but
15-
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16-
or FITNESS FOR A PARTICULAR PURPOSE.
17-
See the GNU Affero General Public License for more details.
3+
Copyright (c) 1998-2023 Apryse Group NV
4+
Authors: Apryse Software.
5+
6+
This program is offered under a commercial and under the AGPL license.
7+
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
8+
9+
AGPL licensing:
10+
This program is free software: you can redistribute it and/or modify
11+
it under the terms of the GNU Affero General Public License as published by
12+
the Free Software Foundation, either version 3 of the License, or
13+
(at your option) any later version.
14+
15+
This program is distributed in the hope that it will be useful,
16+
but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
GNU Affero General Public License for more details.
19+
1820
You should have received a copy of the GNU Affero General Public License
19-
along with this program; if not, see http://www.gnu.org/licenses or write to
20-
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21-
Boston, MA, 02110-1301 USA, or download the license from the following URL:
22-
http://itextpdf.com/terms-of-use/
23-
24-
The interactive user interfaces in modified source and object code versions
25-
of this program must display Appropriate Legal Notices, as required under
26-
Section 5 of the GNU Affero General Public License.
27-
28-
In accordance with Section 7(b) of the GNU Affero General Public License,
29-
a covered work must retain the producer line in every PDF that is created
30-
or manipulated using iText.
31-
32-
You can be released from the requirements of the license by purchasing
33-
a commercial license. Buying such a license is mandatory as soon as you
34-
develop commercial activities involving the iText software without
35-
disclosing the source code of your own applications.
36-
These activities include: offering paid services to customers as an ASP,
37-
serving PDFs on the fly in a web application, shipping iText with a closed
38-
source product.
39-
40-
For more information, please contact iText Software Corp. at this
41-
21+
along with this program. If not, see <https://www.gnu.org/licenses/>.
4222
*/
4323
package com.itextpdf.pdfcleanup;
4424

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

Lines changed: 21 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,29 @@
11
/*
22
This file is part of the iText (R) project.
3-
Copyright (c) 1998-2023 iText Group NV
4-
Authors: iText Software.
5-
6-
This program is free software; you can redistribute it and/or modify
7-
it under the terms of the GNU Affero General Public License version 3
8-
as published by the Free Software Foundation with the addition of the
9-
following permission added to Section 15 as permitted in Section 7(a):
10-
FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY
11-
ITEXT GROUP. ITEXT GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT
12-
OF THIRD PARTY RIGHTS
13-
14-
This program is distributed in the hope that it will be useful, but
15-
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16-
or FITNESS FOR A PARTICULAR PURPOSE.
17-
See the GNU Affero General Public License for more details.
3+
Copyright (c) 1998-2023 Apryse Group NV
4+
Authors: Apryse Software.
5+
6+
This program is offered under a commercial and under the AGPL license.
7+
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
8+
9+
AGPL licensing:
10+
This program is free software: you can redistribute it and/or modify
11+
it under the terms of the GNU Affero General Public License as published by
12+
the Free Software Foundation, either version 3 of the License, or
13+
(at your option) any later version.
14+
15+
This program is distributed in the hope that it will be useful,
16+
but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
GNU Affero General Public License for more details.
19+
1820
You should have received a copy of the GNU Affero General Public License
19-
along with this program; if not, see http://www.gnu.org/licenses or write to
20-
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21-
Boston, MA, 02110-1301 USA, or download the license from the following URL:
22-
http://itextpdf.com/terms-of-use/
23-
24-
The interactive user interfaces in modified source and object code versions
25-
of this program must display Appropriate Legal Notices, as required under
26-
Section 5 of the GNU Affero General Public License.
27-
28-
In accordance with Section 7(b) of the GNU Affero General Public License,
29-
a covered work must retain the producer line in every PDF that is created
30-
or manipulated using iText.
31-
32-
You can be released from the requirements of the license by purchasing
33-
a commercial license. Buying such a license is mandatory as soon as you
34-
develop commercial activities involving the iText software without
35-
disclosing the source code of your own applications.
36-
These activities include: offering paid services to customers as an ASP,
37-
serving PDFs on the fly in a web application, shipping iText with a closed
38-
source product.
39-
40-
For more information, please contact iText Software Corp. at this
41-
21+
along with this program. If not, see <https://www.gnu.org/licenses/>.
4222
*/
4323
package com.itextpdf.pdfcleanup;
4424

4525
import com.itextpdf.commons.utils.MessageFormatUtil;
26+
import com.itextpdf.io.font.FontProgram;
4627
import com.itextpdf.io.image.ImageData;
4728
import com.itextpdf.io.image.ImageDataFactory;
4829
import com.itextpdf.kernel.exceptions.PdfException;
@@ -231,8 +212,8 @@ FilterResult<PdfArray> filterText(TextRenderInfo text) {
231212
if (isTextNotToBeCleaned(ri)) {
232213
textArray.add(ri.getPdfString());
233214
} else {
234-
textArray.add(new PdfNumber(
235-
-ri.getUnscaledWidth() * 1000f / (text.getFontSize() * text.getHorizontalScaling() / 100)
215+
textArray.add(new PdfNumber(FontProgram.convertGlyphSpaceToTextSpace(-ri.getUnscaledWidth()) /
216+
(text.getFontSize() * text.getHorizontalScaling() / FontProgram.HORIZONTAL_SCALING_FACTOR)
236217
));
237218
}
238219
}

0 commit comments

Comments
 (0)