Skip to content

Commit

Permalink
[RELEASE] iText 8.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
iText-CI committed Jan 30, 2024
2 parents 323f77f + 87c49fd commit 2e932a8
Show file tree
Hide file tree
Showing 3,453 changed files with 26,659 additions and 5,761 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
18 changes: 4 additions & 14 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,8 @@ $ mvn clean install \
> >(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
$ vagrant up
$ vagrant ssh -- \
'cd /vagrant ; mvn clean install -Dmaven.test.skip=true' \
> >(tee mvn.log) 2> >(tee mvn-error.log >&2)
```
[1]: https://maven.apache.org/

[2]: https://www.ghostscript.com/

[1]: http://maven.apache.org/
[2]: http://www.ghostscript.com/
[3]: http://www.imagemagick.org/
[4]: https://www.vagrantup.com/
[5]: http://www.ubuntu.com/
[6]: https://www.virtualbox.org/
[3]: https://www.imagemagick.org/
8 changes: 4 additions & 4 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at http://itextpdf.com/contact. All
reported by contacting the project team at https://itextpdf.com/contact. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Expand All @@ -68,7 +68,7 @@ members of the project's leadership.
## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
available at [https://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
[homepage]: https://contributor-covenant.org
[version]: https://contributor-covenant.org/version/1/4/
7 changes: 4 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Please note that this project is released with a [Contributor Code of Conduct][c

We use the [Stack Exchange][stackoverflow] network for free support and [GitHub][github] for code hosting. By using these services, you agree to abide by their terms:

* StackExchange: [http://stackexchange.com/legal](http://stackexchange.com/legal)
* StackExchange: [https://stackexchange.com/legal](https://stackexchange.com/legal)
* Github: [https://help.github.com/articles/github-terms-of-service/](https://help.github.com/articles/github-terms-of-service/)

[cla]: https://itextpdf.com/en/how-buy/legal/itext-contributor-license-agreement
Expand All @@ -168,7 +168,8 @@ We use the [Stack Exchange][stackoverflow] network for free support and [GitHub]
[java-style-guide]: https://www.oracle.com/technetwork/java/codeconvtoc-136057.html
[javadocs]: https://itextpdf.com/api
[pull]: https://github.com/itext/itext7/pulls
[sscce]: http://sscce.org/

[sscce]: https://sscce.org/
[stackoverflow]: https://stackoverflow.com/questions/tagged/itext
[good-questions]: https://stackoverflow.com/help/how-to-ask
[mcve]: https://stackoverflow.com/help/mcve
Expand All @@ -180,4 +181,4 @@ We use the [Stack Exchange][stackoverflow] network for free support and [GitHub]
[git-commit-end]: https://chris.beams.io/posts/git-commit/#end
[git-commit-imperative]: https://chris.beams.io/posts/git-commit/#imperative
[git-commit-wrap-72]: https://chris.beams.io/posts/git-commit/#wrap-72
[git-commit-why-not-how]: https://chris.beams.io/posts/git-commit/#why-not-how
[git-commit-why-not-how]: https://chris.beams.io/posts/git-commit/#why-not-how
225 changes: 185 additions & 40 deletions README.md

Large diffs are not rendered by default.

Binary file added assets/iText_Logo_Small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion barcodes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.itextpdf</groupId>
<artifactId>root</artifactId>
<version>8.0.2</version>
<version>8.0.3</version>
</parent>
<artifactId>barcodes</artifactId>
<name>iText - barcodes</name>
Expand Down
22 changes: 20 additions & 2 deletions barcodes/src/main/java/com/itextpdf/barcodes/Barcode128.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2023 Apryse Group NV
Copyright (c) 1998-2024 Apryse Group NV
Authors: Apryse Software.
This program is offered under a commercial and under the AGPL license.
Expand All @@ -23,8 +23,8 @@ This file is part of the iText (R) project.
package com.itextpdf.barcodes;

import com.itextpdf.barcodes.exceptions.BarcodesExceptionMessageConstant;
import com.itextpdf.kernel.exceptions.PdfException;
import com.itextpdf.kernel.colors.Color;
import com.itextpdf.kernel.exceptions.PdfException;
import com.itextpdf.kernel.font.PdfFont;
import com.itextpdf.kernel.geom.Rectangle;
import com.itextpdf.kernel.pdf.PdfDocument;
Expand All @@ -33,6 +33,10 @@ This file is part of the iText (R) project.
import java.util.HashMap;
import java.util.Map;

/**
* BarCode 128 is a high-density linear barcode symbology defined in ISO/IEC 15417:2007.
* It is used for alphanumeric or numeric-only barcodes. It can encode all 128 characters of ASCII
*/
public class Barcode128 extends Barcode1D {

/** A type of barcode */
Expand Down Expand Up @@ -228,17 +232,31 @@ public Barcode128(PdfDocument document, PdfFont font) {
this.textAlignment = ALIGN_CENTER;
this.codeType = CODE128;
}

/**
* The code set to be used to start encoding.
*/
public enum Barcode128CodeSet {
A,
B,
C,
AUTO
}

/**
* Sets the code set to use.
*
* @param codeSet the code set to use.
*/
public void setCodeSet(Barcode128CodeSet codeSet) {
this.codeSet = codeSet;
}

/**
* Get the code set that is used.
*
* @return the code set.
*/
public Barcode128CodeSet getCodeSet() {
return this.codeSet;
}
Expand Down
34 changes: 31 additions & 3 deletions barcodes/src/main/java/com/itextpdf/barcodes/Barcode1D.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2023 Apryse Group NV
Copyright (c) 1998-2024 Apryse Group NV
Authors: Apryse Software.
This program is offered under a commercial and under the AGPL license.
Expand All @@ -23,18 +23,31 @@ This file is part of the iText (R) project.
package com.itextpdf.barcodes;

import com.itextpdf.io.font.FontProgram;
import com.itextpdf.kernel.geom.Rectangle;
import com.itextpdf.kernel.pdf.canvas.PdfCanvas;
import com.itextpdf.kernel.colors.Color;
import com.itextpdf.kernel.font.PdfFont;
import com.itextpdf.kernel.geom.Rectangle;
import com.itextpdf.kernel.pdf.PdfArray;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.canvas.PdfCanvas;
import com.itextpdf.kernel.pdf.xobject.PdfFormXObject;

/**
* Base class for the barcode types that have 1D representation.
* This means all data is encoded in the width of the bars. And the height of the bars is constant.
*/
public abstract class Barcode1D {

/**
* Constant that defines left alignment.
*/
public static final int ALIGN_LEFT = 1;
/**
* Constant that defines right alignment.
*/
public static final int ALIGN_RIGHT = 2;
/**
* Constant that defines center alignment.
*/
public static final int ALIGN_CENTER = 3;

// Android-Conversion-Skip-Block-Start (java.awt library isn't available on Android)
Expand Down Expand Up @@ -134,6 +147,11 @@ public abstract class Barcode1D {
*/
protected String altText;

/**
* Creates new {@link Barcode1D} instance.
*
* @param document The document
*/
protected Barcode1D(PdfDocument document) {
this.document = document;
}
Expand Down Expand Up @@ -192,6 +210,11 @@ public void setFont(PdfFont font) {
this.font = font;
}

/**
* Gets the size of the text.
*
* @return the size
*/
public float getSize() {
return size;
}
Expand Down Expand Up @@ -527,6 +550,11 @@ public void fitWidth(float width) {
setX(x * width / getBarcodeSize().getWidth());
}

/**
* Gets the descender value of the font.
*
* @return the descender value of the font
*/
protected float getDescender() {
final float sizeCoefficient = FontProgram.convertTextSpaceToGlyphSpace(size);
return font.getFontProgram().getFontMetrics().getTypoDescender() * sizeCoefficient;
Expand Down
11 changes: 8 additions & 3 deletions barcodes/src/main/java/com/itextpdf/barcodes/Barcode2D.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2023 Apryse Group NV
Copyright (c) 1998-2024 Apryse Group NV
Authors: Apryse Software.
This program is offered under a commercial and under the AGPL license.
Expand All @@ -22,12 +22,17 @@ This file is part of the iText (R) project.
*/
package com.itextpdf.barcodes;

import com.itextpdf.kernel.geom.Rectangle;
import com.itextpdf.kernel.pdf.canvas.PdfCanvas;
import com.itextpdf.kernel.colors.Color;
import com.itextpdf.kernel.geom.Rectangle;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.canvas.PdfCanvas;
import com.itextpdf.kernel.pdf.xobject.PdfFormXObject;

/**
* This is a class that is used to implement the logic common to all 2D barcodes.
* A 2D barcode is a barcode with two dimensions; this means that
* data can be encoded vertically and horizontally.
*/
public abstract class Barcode2D {

protected static final float DEFAULT_MODULE_SIZE = 1;
Expand Down
16 changes: 13 additions & 3 deletions barcodes/src/main/java/com/itextpdf/barcodes/Barcode39.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2023 Apryse Group NV
Copyright (c) 1998-2024 Apryse Group NV
Authors: Apryse Software.
This program is offered under a commercial and under the AGPL license.
Expand All @@ -22,12 +22,22 @@ This file is part of the iText (R) project.
*/
package com.itextpdf.barcodes;

import com.itextpdf.kernel.colors.Color;
import com.itextpdf.kernel.font.PdfFont;
import com.itextpdf.kernel.geom.Rectangle;
import com.itextpdf.kernel.pdf.canvas.PdfCanvas;
import com.itextpdf.kernel.colors.Color;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.canvas.PdfCanvas;

/**
* This class represents the barcode Code 39.
* <p>
* Code 39 is a variable length, discrete
* barcode symbology defined in ISO/IEC 16388:2007.
* <p>
* The Code 39 specification defines 43 characters, consisting of uppercase letters (A through Z), numeric digits (0
* through 9) and a number of special characters (-, ., $, /, +, %, and space). An additional character (denoted '*') is
* used for both start and stop delimiters. Each character is composed of nine elements: five bars and four spaces.
*/
public class Barcode39 extends Barcode1D {

/**
Expand Down
20 changes: 17 additions & 3 deletions barcodes/src/main/java/com/itextpdf/barcodes/BarcodeCodabar.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2023 Apryse Group NV
Copyright (c) 1998-2024 Apryse Group NV
Authors: Apryse Software.
This program is offered under a commercial and under the AGPL license.
Expand All @@ -23,12 +23,19 @@ This file is part of the iText (R) project.
package com.itextpdf.barcodes;

import com.itextpdf.barcodes.exceptions.BarcodesExceptionMessageConstant;
import com.itextpdf.kernel.colors.Color;
import com.itextpdf.kernel.font.PdfFont;
import com.itextpdf.kernel.geom.Rectangle;
import com.itextpdf.kernel.pdf.canvas.PdfCanvas;
import com.itextpdf.kernel.colors.Color;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.canvas.PdfCanvas;

/**
* Implementation of the Codabar barcode.
* <p>
* Codabar was designed to be accurately read even when printed on dot-matrix printers for multi-part forms such as
* FedEx airbills and blood bank forms, where variants are still in use as of 2007. Although newer symbologies hold more
* information in a smaller space.
*/
public class BarcodeCodabar extends Barcode1D {

/**
Expand Down Expand Up @@ -169,6 +176,13 @@ public static byte[] getBarsCodabar(String text) {
return bars;
}

/**
* Calculates the checksum.
*
* @param code the value to calculate the checksum for
*
* @return the checksum for the given value
*/
public static String calculateChecksum(String code) {
if (code.length() < 2)
return code;
Expand Down
Loading

0 comments on commit 2e932a8

Please sign in to comment.