PHPackages                             amattu2/avery-fpdf-labels - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. amattu2/avery-fpdf-labels

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

amattu2/avery-fpdf-labels
=========================

A PHP library designed to assist in building Avery Label sheets with FPDF

v2.3.0(1y ago)310.7k7[1 PRs](https://github.com/amattu2/avery-fpdf-labels/pulls)AGPL-3.0-or-laterPHPCI passing

Since Jan 24Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/amattu2/avery-fpdf-labels)[ Packagist](https://packagist.org/packages/amattu2/avery-fpdf-labels)[ RSS](/packages/amattu2-avery-fpdf-labels/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (2)Versions (13)Used By (0)

Introduction
============

[](#introduction)

This is a PHP project to implement support for generating [Avery.com](https://www.avery.com/templates) label templates using [FPDF](https://fpdf.org).

Templates
=========

[](#templates)

Supported
---------

[](#supported)

The currently implemented templates are listed below.

- Avery 5160
- Avery 5163
- Avery Presta 94107
- Avery 5392

Upcoming
--------

[](#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
=====

[](#usage)

Install
-------

[](#install)

### Composer

[](#composer)

To install via composer, follow the simple steps below.

```
composer install amattu2/avery-fpdf-labels
composer install fpdf/fpdf
```

**NOTE:** You can use any fork of FPDF you want as long as it implements the same methods as FPDF.

Then

```
require 'vendor/autoload.php';

$template = new amattu2\LabelSheet("Avery5160");
$pdf = new Fpdf\Fpdf();
```

---

### Direct

[](#direct)

If you choose to install without composer support, you can clone the repository directly. **You will need to include FPDF also.**

```
git clone https://github.com/amattu2/avery-fpdf-labels
```

Then

```
require 'fpdf/Fpdf.php'; // Install FPDF manually
require 'src/LabelSheet.php';

$template = new amattu2\LabelSheet("Avery5160");
$pdf = new Fpdf\Fpdf();
```

---

Usage
-----

[](#usage-1)

See [example.php](example.php) for demonstration of usage.

### Text Label

[](#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.

```
addTextLabel(array $lines, ?string $align = "C", int $row = null, int $col = null): void
```

```
$template->addTextLabel([
  "line 1",
  "line 2",
  "line 3",
  // ...
])
```

### Image Label

[](#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.

```
addImageLabel(string $path, int $row = null, int $col = null): void
```

```
$template->addImageLabel("https://api.placeholder.app/image/350x350/.png");
```

### Custom Labels

[](#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.

```
addCustomLabel(LabelInterface $label): void
```

The custom label must implement the `LabelInterface` interface. See [/src/LabelInterface.php](/src/LabelInterface.php) for more information.

Requirements &amp; Dependencies
===============================

[](#requirements--dependencies)

- FPDF 1.81 Minimum \[\]
- PHP 7.4+ \[\]

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance64

Regular maintenance activity

Popularity28

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~74 days

Total

11

Last Release

464d ago

Major Versions

v1.0.2 → 2.0.0.x-dev2023-03-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/45d27ac587ba85712309c969ca2e277df1044c60ce9f2f8a5ca69118211e30d6?d=identicon)[amattu2](/maintainers/amattu2)

---

Top Contributors

[![amattu2](https://avatars.githubusercontent.com/u/38357871?v=4)](https://github.com/amattu2 "amattu2 (41 commits)")[![Buddierdl](https://avatars.githubusercontent.com/u/49448610?v=4)](https://github.com/Buddierdl "Buddierdl (2 commits)")[![j4nr6n](https://avatars.githubusercontent.com/u/3661151?v=4)](https://github.com/j4nr6n "j4nr6n (2 commits)")[![ncavallini](https://avatars.githubusercontent.com/u/73892369?v=4)](https://github.com/ncavallini "ncavallini (1 commits)")

---

Tags

averyfpdfpdfphptemplate

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/amattu2-avery-fpdf-labels/health.svg)

```
[![Health](https://phpackages.com/badges/amattu2-avery-fpdf-labels/health.svg)](https://phpackages.com/packages/amattu2-avery-fpdf-labels)
```

###  Alternatives

[phpoffice/phpspreadsheet

PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine

13.9k293.5M1.3k](/packages/phpoffice-phpspreadsheet)[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k32.1M102](/packages/spatie-browsershot)[smalot/pdfparser

Pdf parser library. Can read and extract information from pdf file.

2.7k34.5M216](/packages/smalot-pdfparser)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[openspout/openspout

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.1k57.6M131](/packages/openspout-openspout)[keboola/csv

Keboola CSV reader and writer

1451.8M21](/packages/keboola-csv)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
