Skip to content

Commit

Permalink
[RELEASE] iText 7 8.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
iText-CI authored and AnhelinaM committed Apr 27, 2023
2 parents c2babc7 + 7050966 commit 4e9491a
Show file tree
Hide file tree
Showing 3,346 changed files with 167,724 additions and 74,622 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
14 changes: 12 additions & 2 deletions BUILDING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
To build **iText 7 Community**, [Maven][1] must be installed.
To build **iText Community**, [Maven][1] must be installed.

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

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:
```bash
$ mvn clean install \
-P test,bouncy-castle-fips-test,!bouncy-castle-test \
-Dmaven.test.failure.ignore=false \
-DITEXT_GS_EXEC="gs command" \
-DITEXT_MAGICK_COMPARE_EXEC="magick compare command" \
> >(tee mvn.log) 2> >(tee mvn-error.log >&2)
```

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.
```bash
$ vagrant box add ubuntu/trusty64
Expand Down
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to iText 7 Community
# Contributing to iText Community

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

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

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

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

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

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

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

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

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

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

Expand Down Expand Up @@ -169,7 +169,7 @@ We use the [Stack Exchange][stackoverflow] network for free support and [GitHub]
[javadocs]: https://itextpdf.com/api
[pull]: https://github.com/itext/itext7/pulls
[sscce]: http://sscce.org/
[stackoverflow]: https://stackoverflow.com/questions/tagged/itext7
[stackoverflow]: https://stackoverflow.com/questions/tagged/itext
[good-questions]: https://stackoverflow.com/help/how-to-ask
[mcve]: https://stackoverflow.com/help/mcve
[support]: https://itextpdf.com/support
Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
**[iText 7 Community][itext]** consists of several jars.
**[iText Community][itext]** consists of several jars.

The iText 7 Core/Community release contains:
The iText Core/Community release contains:

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

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

You can also [build iText 7 Community from source][building].
You can also [build iText Community from source][building].

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

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

**iText 7** is dual licensed as [AGPL][agpl]/[Commercial software][sales].
**iText** is dual licensed as [AGPL][agpl]/[Commercial software][sales].

AGPL is a free / open source software license.

Expand All @@ -48,6 +51,7 @@ Contact [sales] for more info.
[agpl]: LICENSE.md
[building]: BUILDING.md
[contributing]: CONTRIBUTING.md
[layoutMd]: layout/MODULE_OVERVIEW.md
[itext]: https://itextpdf.com/
[github]: https://github.com/itext/itext7
[latest]: https://github.com/itext/itext7/releases/latest
Expand Down
25 changes: 2 additions & 23 deletions barcodes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<parent>
<groupId>com.itextpdf</groupId>
<artifactId>root</artifactId>
<version>7.2.5</version>
<version>8.0.0</version>
</parent>
<artifactId>barcodes</artifactId>
<name>iText 7 - barcodes</name>
<name>iText - barcodes</name>
<url>https://itextpdf.com/</url>
<dependencies>
<dependency>
Expand All @@ -22,25 +22,4 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<includes>
<include>**/*.java</include>
</includes>
<groups>${integrationtests}</groups>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<groups>${unittests}</groups>
</configuration>
</plugin>
</plugins>
</build>
</project>
61 changes: 21 additions & 40 deletions barcodes/src/main/java/com/itextpdf/barcodes/Barcode128.java
Original file line number Diff line number Diff line change
@@ -1,49 +1,28 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2023 iText Group NV
Authors: Bruno Lowagie, Paulo Soares, et al.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3
as published by the Free Software Foundation with the addition of the
following permission added to Section 15 as permitted in Section 7(a):
FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY
ITEXT GROUP. ITEXT GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT
OF THIRD PARTY RIGHTS
Copyright (c) 1998-2023 Apryse Group NV
Authors: Apryse Software.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, see http://www.gnu.org/licenses or write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA, 02110-1301 USA, or download the license from the following URL:
http://itextpdf.com/terms-of-use/
This program is offered under a commercial and under the AGPL license.
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
The interactive user interfaces in modified source and object code versions
of this program must display Appropriate Legal Notices, as required under
Section 5 of the GNU Affero General Public License.
AGPL licensing:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
In accordance with Section 7(b) of the GNU Affero General Public License,
a covered work must retain the producer line in every PDF that is created
or manipulated using iText.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You can be released from the requirements of the license by purchasing
a commercial license. Buying such a license is mandatory as soon as you
develop commercial activities involving the iText software without
disclosing the source code of your own applications.
These activities include: offering paid services to customers as an ASP,
serving PDFs on the fly in a web application, shipping iText with a closed
source product.
For more information, please contact iText Software Corp. at this
address: [email protected]
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.itextpdf.barcodes;

import com.itextpdf.barcodes.exceptions.BarcodeExceptionMessageConstant;
import com.itextpdf.barcodes.exceptions.BarcodesExceptionMessageConstant;
import com.itextpdf.kernel.exceptions.PdfException;
import com.itextpdf.kernel.colors.Color;
import com.itextpdf.kernel.font.PdfFont;
Expand Down Expand Up @@ -353,7 +332,7 @@ public static String getRawText(String text, boolean ucc, Barcode128CodeSet code
for (int k = 0; k < tLen; ++k) {
c = text.charAt(k);
if (c > 127 && c != FNC1)
throw new PdfException(BarcodeExceptionMessageConstant.THERE_ARE_ILLEGAL_CHARACTERS_FOR_BARCODE_128);
throw new PdfException(BarcodesExceptionMessageConstant.THERE_ARE_ILLEGAL_CHARACTERS_FOR_BARCODE_128);
}
c = text.charAt(0);
char currentCode = getStartSymbol(codeSet);
Expand Down Expand Up @@ -384,7 +363,7 @@ public static String getRawText(String text, boolean ucc, Barcode128CodeSet code
++index;
}
if (codeSet != Barcode128CodeSet.AUTO && currentCode != getStartSymbol(codeSet))
throw new PdfException(BarcodeExceptionMessageConstant.THERE_ARE_ILLEGAL_CHARACTERS_FOR_BARCODE_128);
throw new PdfException(BarcodesExceptionMessageConstant.THERE_ARE_ILLEGAL_CHARACTERS_FOR_BARCODE_128);
while (index < tLen) {
switch (currentCode) {
case START_A: {
Expand Down Expand Up @@ -453,7 +432,7 @@ else if (c < ' ') {
break;
}
if (codeSet != Barcode128CodeSet.AUTO && currentCode != getStartSymbol(codeSet))
throw new PdfException(BarcodeExceptionMessageConstant.THERE_ARE_ILLEGAL_CHARACTERS_FOR_BARCODE_128);
throw new PdfException(BarcodesExceptionMessageConstant.THERE_ARE_ILLEGAL_CHARACTERS_FOR_BARCODE_128);
}
return out;
}
Expand Down Expand Up @@ -718,6 +697,7 @@ public void setCode(String code) {
}
}

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

private static char getStartSymbol(Barcode128CodeSet codeSet) {
switch (codeSet) {
Expand Down
67 changes: 25 additions & 42 deletions barcodes/src/main/java/com/itextpdf/barcodes/Barcode1D.java
Original file line number Diff line number Diff line change
@@ -1,45 +1,24 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2023 iText Group NV
Authors: Bruno Lowagie, Paulo Soares, et al.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3
as published by the Free Software Foundation with the addition of the
following permission added to Section 15 as permitted in Section 7(a):
FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY
ITEXT GROUP. ITEXT GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT
OF THIRD PARTY RIGHTS
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Affero General Public License for more details.
Copyright (c) 1998-2023 Apryse Group NV
Authors: Apryse Software.
This program is offered under a commercial and under the AGPL license.
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
AGPL licensing:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, see http://www.gnu.org/licenses or write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA, 02110-1301 USA, or download the license from the following URL:
http://itextpdf.com/terms-of-use/
The interactive user interfaces in modified source and object code versions
of this program must display Appropriate Legal Notices, as required under
Section 5 of the GNU Affero General Public License.
In accordance with Section 7(b) of the GNU Affero General Public License,
a covered work must retain the producer line in every PDF that is created
or manipulated using iText.
You can be released from the requirements of the license by purchasing
a commercial license. Buying such a license is mandatory as soon as you
develop commercial activities involving the iText software without
disclosing the source code of your own applications.
These activities include: offering paid services to customers as an ASP,
serving PDFs on the fly in a web application, shipping iText with a closed
source product.
For more information, please contact iText Software Corp. at this
address: [email protected]
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.itextpdf.barcodes;

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

// Android-Conversion-Skip-Block-Start (java.awt library isn't available on Android)
/**
* The default color to draw if a bar is present.
*/
Expand All @@ -66,7 +46,8 @@ public abstract class Barcode1D {
* The default color to draw if a bar is not present.
*/
protected final java.awt.Color DEFAULT_BAR_BACKGROUND_COLOR = java.awt.Color.WHITE;

// Android-Conversion-Skip-Block-End

protected PdfDocument document;

/**
Expand Down Expand Up @@ -498,6 +479,7 @@ public void setAltText(String altText) {
this.altText = altText;
}

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

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

protected float getDescender() {
float sizeCoef = size / FontProgram.UNITS_NORMALIZATION;
return font.getFontProgram().getFontMetrics().getTypoDescender() * sizeCoef;
final float sizeCoefficient = FontProgram.convertTextSpaceToGlyphSpace(size);
return font.getFontProgram().getFontMetrics().getTypoDescender() * sizeCoefficient;
}
}
Loading

0 comments on commit 4e9491a

Please sign in to comment.