This project generates a PDF file containing different types of barcodes using the Code128 barcode format. It reads a list of barcodes and corresponding descriptions from an XML file, and creates a PDF document with the barcodes.
Please note that I based this off an example found in iText in Action - 2nd Edition written by Bruno Lowagie (ISBN: 9781935182610)
- Supports retrieval of the barcode list XML from either a URL or a local file.
- Generates Code128 barcodes for each entry in the XML.
- Creates a PDF document with the generated barcodes.
- Java Development Kit (JDK) 8 or higher
- Apache Maven (for building the project)
-
Clone the repository:
git clone https://github.com/calebjeffery/BarcodeGenerator.git
-
Navigate to the project directory:
cd BarcodeGenerator
-
Build the project using Maven:
mvn package
-
Run the application with the desired arguments:
java -jar target/BarcodeGenerator-0.0.1-SNAPSHOT.jar -o <output-file> -t <xml-type> -p <xml-path>
Replace
<output-file>
with the desired filename for the generated PDF,<xml-type>
with either "URL" or "FILE" depending on how the XML file is retrieved, and<xml-path>
with the URL or filepath of the barcode list XML.Example:
java -jar target/BarcodeGenerator-0.0.1-SNAPSHOT.jar -o barcode.pdf -t FILE -p ./resources/data.xml
-
The generated PDF file will be saved as
<output-file>
in the current directory.
This project uses the following dependencies:
- iText PDF (version 7.0.4)
- Apache Commons Codec (version 1.9)
- Apache Argparse4j (version 0.8.1)
This project is licensed under the GNU Affero General Public License (AGPL).