Download the PHP package amattu2/avery-fpdf-labels without Composer
On this page you can find all versions of the php package amattu2/avery-fpdf-labels. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download amattu2/avery-fpdf-labels
More information about amattu2/avery-fpdf-labels
Files in amattu2/avery-fpdf-labels
Package avery-fpdf-labels
Short Description A PHP library designed to assist in building Avery Label sheets with FPDF
License AGPL-3.0-or-later
Informations about the package avery-fpdf-labels
Introduction
This is a PHP project to implement support for generating Avery.com label templates using FPDF.
Templates
Supported
The currently implemented templates are listed below.
- Avery 5160
- Avery 5163
- Avery Presta 94107
- Avery 5392
Upcoming
There are plans to support the following templates but If you have an urgent need for a specific template to be supported, open a issue to let me know.
- Avery 5162
- Avery 5195
- Avery 5816
- Avery 5817
- Avery 8160
Feel free to contribute to the development effort by submitting a pull request for any of the above templates or any other templates you would like to see supported.
Usage
Install
Composer
To install via composer, follow the simple steps below.
NOTE: You can use any fork of FPDF you want as long as it implements the same methods as FPDF.
Then
Direct
If you choose to install without composer support, you can clone the repository directly. You will need to include FPDF also.
Then
Usage
See example.php for demonstration of usage.
Text Label
Use the addTextLabel
method to add a text label to the template. The method accepts an array of strings, an optional alignment parameter, and optional row and column parameters. This would typically be used for address labels.
Image Label
Use the addImageLabel
method to add an image label to the template. The method accepts a path to an image file and optional row and column parameters.
Custom Labels
The addCustomLabel
method allows you to expand upon the current label types (e.g. adding barcodes). You must instantiate your own implementation of the custom label and pass it to this method.
The custom label must implement the LabelInterface
interface. See /src/LabelInterface.php for more information.
Requirements & Dependencies
- FPDF 1.81 Minimum [http://www.fpdf.org/]
- PHP 7.4+ [https://php.net]