Skip to content

Commit 4e9491a

Browse files
iText-CIAnhelinaM
authored andcommitted
[RELEASE] iText 7 8.0.0
2 parents c2babc7 + 7050966 commit 4e9491a

File tree

3,346 files changed

+167724
-74622
lines changed

Some content is hidden

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

3,346 files changed

+167724
-74622
lines changed

BUILDING.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
To build **iText 7 Community**, [Maven][1] must be installed.
1+
To build **iText Community**, [Maven][1] must be installed.
22

3-
Running install without a profile will generate the **iText 7 Community** jars:
3+
Running install without a profile will generate the **iText Community** jars:
44
```bash
55
$ mvn clean install \
66
-Dmaven.test.skip=true \
@@ -32,6 +32,16 @@ $ mvn clean install \
3232
> >(tee mvn.log) 2> >(tee mvn-error.log >&2)
3333
```
3434

35+
By default tests are run with the non FIPS mode version of Bouncy Castle. To run the tests in FIPS mode the profile bouncy-castle-test must be deactivated and the profile bouncy-castle-fips-test must be activated:
36+
```bash
37+
$ mvn clean install \
38+
-P test,bouncy-castle-fips-test,!bouncy-castle-test \
39+
-Dmaven.test.failure.ignore=false \
40+
-DITEXT_GS_EXEC="gs command" \
41+
-DITEXT_MAGICK_COMPARE_EXEC="magick compare command" \
42+
> >(tee mvn.log) 2> >(tee mvn-error.log >&2)
43+
```
44+
3545
You can use the supplied `Vagrantfile` to get a [Vagrant][4] VM ([Ubuntu][5] 14.04 LTS - Trusty Tahr, with [VirtualBox][6]) with all the required software installed.
3646
```bash
3747
$ vagrant box add ubuntu/trusty64

CONTRIBUTING.md

Lines changed: 7 additions & 7 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

@@ -55,7 +55,7 @@ chances of your issue being dealt with quickly:
5555
* **Related Issues** - has a similar issue been reported before?
5656
* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
5757
causing the problem (line of code or commit)
58-
* **Tag the question** - add the tag `itext7` to your question so we can find it.
58+
* **Tag the question** - add the tag `itext` to your question so we can find it.
5959

6060
**If you get help, help others. Good karma rulez!**
6161

@@ -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

@@ -169,7 +169,7 @@ We use the [Stack Exchange][stackoverflow] network for free support and [GitHub]
169169
[javadocs]: https://itextpdf.com/api
170170
[pull]: https://github.com/itext/itext7/pulls
171171
[sscce]: http://sscce.org/
172-
[stackoverflow]: https://stackoverflow.com/questions/tagged/itext7
172+
[stackoverflow]: https://stackoverflow.com/questions/tagged/itext
173173
[good-questions]: https://stackoverflow.com/help/how-to-ask
174174
[mcve]: https://stackoverflow.com/help/mcve
175175
[support]: https://itextpdf.com/support

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
**[iText 7 Community][itext]** consists of several jars.
1+
**[iText Community][itext]** consists of several jars.
22

3-
The iText 7 Core/Community release contains:
3+
The iText Core/Community release contains:
44

55
- ```kernel-x.y.z.jar```: low-level functionality
66
- ```io-x.y.z.jar```: low-level functionality
7-
- ```layout-x.y.z.jar```: high-level functionality
7+
- ```layout-x.y.z.jar```: high-level functionality. For more information see [layout overview][layoutMd].
88
- ```forms-x.y.z.jar```: AcroForms
99
- ```pdfa-x.y.z.jar```: PDF/A-specific functionality
1010
- ```pdftest-x.y.z.jar```: test helper classes
@@ -15,20 +15,23 @@ The iText 7 Core/Community release contains:
1515
- ```styled-xml-parser-x.y.z.jar```: use this if you need support for SVG or html2pdf
1616
- ```svg-x.y.z.jar```: SVG support
1717
- ```commons-x.y.z.jar```: commons module
18+
- ```bouncy-castle-connector-x.y.z.jar```: auxiliary internal module
19+
- ```bouncy-castle-adapter-x.y.z.jar```: use this to apply BouncyCastle as low-level cryptography library
20+
- ```bouncy-castle-fips-adapter-x.y.z.jar```: use this to apply BouncyCastle FIPS as low-level cryptography library
1821

19-
The **iText 7 Community** source code is hosted on [Github][github], where you can also [download the latest releases][latest].
22+
The **iText Community** source code is hosted on [Github][github], where you can also [download the latest releases][latest].
2023

21-
You can also [build iText 7 Community from source][building].
24+
You can also [build iText Community from source][building].
2225

2326
We also provide opensource add-ons and tools to complement the core functionality:
2427
- [pdfHTML][pdfhtml] — allows you to easily convert HTML to PDF or iText objects
2528
- [pdfSweep][pdfsweep] — a highly efficient PDF tool to merge, split and redact data
2629
- [RUPS][rups] — a Java tool that can help you debug PDFs
2730

28-
If you have an idea on how to improve **iText 7 Community** and you want to submit code,
31+
If you have an idea on how to improve **iText Community** and you want to submit code,
2932
please read our [Contribution Guidelines][contributing].
3033

31-
**iText 7** is dual licensed as [AGPL][agpl]/[Commercial software][sales].
34+
**iText** is dual licensed as [AGPL][agpl]/[Commercial software][sales].
3235

3336
AGPL is a free / open source software license.
3437

@@ -48,6 +51,7 @@ Contact [sales] for more info.
4851
[agpl]: LICENSE.md
4952
[building]: BUILDING.md
5053
[contributing]: CONTRIBUTING.md
54+
[layoutMd]: layout/MODULE_OVERVIEW.md
5155
[itext]: https://itextpdf.com/
5256
[github]: https://github.com/itext/itext7
5357
[latest]: https://github.com/itext/itext7/releases/latest

barcodes/pom.xml

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<parent>
55
<groupId>com.itextpdf</groupId>
66
<artifactId>root</artifactId>
7-
<version>7.2.5</version>
7+
<version>8.0.0</version>
88
</parent>
99
<artifactId>barcodes</artifactId>
10-
<name>iText 7 - barcodes</name>
10+
<name>iText - barcodes</name>
1111
<url>https://itextpdf.com/</url>
1212
<dependencies>
1313
<dependency>
@@ -22,25 +22,4 @@
2222
<scope>test</scope>
2323
</dependency>
2424
</dependencies>
25-
<build>
26-
<plugins>
27-
<plugin>
28-
<groupId>org.apache.maven.plugins</groupId>
29-
<artifactId>maven-failsafe-plugin</artifactId>
30-
<configuration>
31-
<includes>
32-
<include>**/*.java</include>
33-
</includes>
34-
<groups>${integrationtests}</groups>
35-
</configuration>
36-
</plugin>
37-
<plugin>
38-
<groupId>org.apache.maven.plugins</groupId>
39-
<artifactId>maven-surefire-plugin</artifactId>
40-
<configuration>
41-
<groups>${unittests}</groups>
42-
</configuration>
43-
</plugin>
44-
</plugins>
45-
</build>
4625
</project>

barcodes/src/main/java/com/itextpdf/barcodes/Barcode128.java

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

46-
import com.itextpdf.barcodes.exceptions.BarcodeExceptionMessageConstant;
25+
import com.itextpdf.barcodes.exceptions.BarcodesExceptionMessageConstant;
4726
import com.itextpdf.kernel.exceptions.PdfException;
4827
import com.itextpdf.kernel.colors.Color;
4928
import com.itextpdf.kernel.font.PdfFont;
@@ -353,7 +332,7 @@ public static String getRawText(String text, boolean ucc, Barcode128CodeSet code
353332
for (int k = 0; k < tLen; ++k) {
354333
c = text.charAt(k);
355334
if (c > 127 && c != FNC1)
356-
throw new PdfException(BarcodeExceptionMessageConstant.THERE_ARE_ILLEGAL_CHARACTERS_FOR_BARCODE_128);
335+
throw new PdfException(BarcodesExceptionMessageConstant.THERE_ARE_ILLEGAL_CHARACTERS_FOR_BARCODE_128);
357336
}
358337
c = text.charAt(0);
359338
char currentCode = getStartSymbol(codeSet);
@@ -384,7 +363,7 @@ public static String getRawText(String text, boolean ucc, Barcode128CodeSet code
384363
++index;
385364
}
386365
if (codeSet != Barcode128CodeSet.AUTO && currentCode != getStartSymbol(codeSet))
387-
throw new PdfException(BarcodeExceptionMessageConstant.THERE_ARE_ILLEGAL_CHARACTERS_FOR_BARCODE_128);
366+
throw new PdfException(BarcodesExceptionMessageConstant.THERE_ARE_ILLEGAL_CHARACTERS_FOR_BARCODE_128);
388367
while (index < tLen) {
389368
switch (currentCode) {
390369
case START_A: {
@@ -453,7 +432,7 @@ else if (c < ' ') {
453432
break;
454433
}
455434
if (codeSet != Barcode128CodeSet.AUTO && currentCode != getStartSymbol(codeSet))
456-
throw new PdfException(BarcodeExceptionMessageConstant.THERE_ARE_ILLEGAL_CHARACTERS_FOR_BARCODE_128);
435+
throw new PdfException(BarcodesExceptionMessageConstant.THERE_ARE_ILLEGAL_CHARACTERS_FOR_BARCODE_128);
457436
}
458437
return out;
459438
}
@@ -718,6 +697,7 @@ public void setCode(String code) {
718697
}
719698
}
720699

700+
// Android-Conversion-Skip-Block-Start (java.awt library isn't available on Android)
721701
/**
722702
* Creates a <CODE>java.awt.Image</CODE>. This image only
723703
* contains the bars without any text.
@@ -766,6 +746,7 @@ public java.awt.Image createAwtImage(java.awt.Color foreground, java.awt.Color b
766746
}
767747
return canvas.createImage(new java.awt.image.MemoryImageSource(fullWidth, height, pix, 0, fullWidth));
768748
}
749+
// Android-Conversion-Skip-Block-End
769750

770751
private static char getStartSymbol(Barcode128CodeSet codeSet) {
771752
switch (codeSet) {

barcodes/src/main/java/com/itextpdf/barcodes/Barcode1D.java

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

@@ -58,6 +37,7 @@ public abstract class Barcode1D {
5837
public static final int ALIGN_RIGHT = 2;
5938
public static final int ALIGN_CENTER = 3;
6039

40+
// Android-Conversion-Skip-Block-Start (java.awt library isn't available on Android)
6141
/**
6242
* The default color to draw if a bar is present.
6343
*/
@@ -66,7 +46,8 @@ public abstract class Barcode1D {
6646
* The default color to draw if a bar is not present.
6747
*/
6848
protected final java.awt.Color DEFAULT_BAR_BACKGROUND_COLOR = java.awt.Color.WHITE;
69-
49+
// Android-Conversion-Skip-Block-End
50+
7051
protected PdfDocument document;
7152

7253
/**
@@ -498,6 +479,7 @@ public void setAltText(String altText) {
498479
this.altText = altText;
499480
}
500481

482+
// Android-Conversion-Skip-Block-Start (java.awt library isn't available on Android)
501483
/**
502484
* Creates a <CODE>java.awt.Image</CODE>. This image only
503485
* contains the bars without any text.
@@ -507,6 +489,7 @@ public void setAltText(String altText) {
507489
* @return the image
508490
*/
509491
public abstract java.awt.Image createAwtImage(java.awt.Color foreground, java.awt.Color background);
492+
// Android-Conversion-Skip-Block-End
510493

511494
/**
512495
* Creates a PdfFormXObject with the barcode. Default bar color and text color will be used.
@@ -545,7 +528,7 @@ public void fitWidth(float width) {
545528
}
546529

547530
protected float getDescender() {
548-
float sizeCoef = size / FontProgram.UNITS_NORMALIZATION;
549-
return font.getFontProgram().getFontMetrics().getTypoDescender() * sizeCoef;
531+
final float sizeCoefficient = FontProgram.convertTextSpaceToGlyphSpace(size);
532+
return font.getFontProgram().getFontMetrics().getTypoDescender() * sizeCoefficient;
550533
}
551534
}

0 commit comments

Comments
 (0)