{"id":27193397,"url":"https://github.com/amattu2/avery-fpdf-labels","last_synced_at":"2025-04-09T18:55:48.321Z","repository":{"id":42672636,"uuid":"229508024","full_name":"amattu2/avery-fpdf-labels","owner":"amattu2","description":"A PHP class for generating PDF Avery Label sheets using FPDF.","archived":false,"fork":false,"pushed_at":"2025-02-02T22:10:47.000Z","size":589,"stargazers_count":2,"open_issues_count":2,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-13T01:05:30.764Z","etag":null,"topics":["avery","fpdf","pdf","php","template"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/amattu2/avery-fpdf-labels","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amattu2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-22T02:24:00.000Z","updated_at":"2025-02-02T22:05:06.000Z","dependencies_parsed_at":"2024-04-06T01:38:36.682Z","dependency_job_id":"11e6cb8d-5980-4373-af8d-4433f49b1469","html_url":"https://github.com/amattu2/avery-fpdf-labels","commit_stats":{"total_commits":31,"total_committers":4,"mean_commits":7.75,"dds":"0.22580645161290325","last_synced_commit":"ed570a992142c32b2ed6cdb58ceaa878436cd65e"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":"amattu2/project-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amattu2%2Favery-fpdf-labels","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amattu2%2Favery-fpdf-labels/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amattu2%2Favery-fpdf-labels/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amattu2%2Favery-fpdf-labels/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amattu2","download_url":"https://codeload.github.com/amattu2/avery-fpdf-labels/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248094051,"owners_count":21046762,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["avery","fpdf","pdf","php","template"],"created_at":"2025-04-09T18:55:47.685Z","updated_at":"2025-04-09T18:55:48.312Z","avatar_url":"https://github.com/amattu2.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n\nThis is a PHP project to implement support for generating [Avery.com](https://www.avery.com/templates) label templates using [FPDF](https://fpdf.org).\n\n# Templates\n\n## Supported\n\nThe currently implemented templates are listed below.\n\n- Avery 5160\n- Avery 5163\n- Avery Presta 94107\n- Avery 5392\n\n## Upcoming\n\nThere 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.**\n\n- Avery 5162\n- Avery 5195\n- Avery 5816\n- Avery 5817\n- Avery 8160\n\nFeel 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.\n\n# Usage\n\n## Install\n\n### Composer\n\nTo install via composer, follow the simple steps below.\n\n```bash\ncomposer install amattu2/avery-fpdf-labels\ncomposer install fpdf/fpdf\n```\n\n**NOTE:** You can use any fork of FPDF you want as long as it implements the same methods as FPDF.\n\nThen\n\n```php\nrequire 'vendor/autoload.php';\n\n$template = new amattu2\\LabelSheet(\"Avery5160\");\n$pdf = new Fpdf\\Fpdf();\n```\n\n---\n\n### Direct\n\nIf you choose to install without composer support, you can clone the repository directly. **You will need to include FPDF also.**\n\n```bash\ngit clone https://github.com/amattu2/avery-fpdf-labels\n```\n\nThen\n\n```php\nrequire 'fpdf/Fpdf.php'; // Install FPDF manually\nrequire 'src/LabelSheet.php';\n\n$template = new amattu2\\LabelSheet(\"Avery5160\");\n$pdf = new Fpdf\\Fpdf();\n```\n\n---\n\n## Usage\n\nSee [example.php](example.php) for demonstration of usage.\n\n### Text Label\n\nUse 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.\n\n```php\naddTextLabel(array $lines, ?string $align = \"C\", int $row = null, int $col = null): void\n```\n\n```php\n$template-\u003eaddTextLabel([\n  \"line 1\",\n  \"line 2\",\n  \"line 3\",\n  // ...\n])\n```\n\n### Image Label\n\nUse 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.\n\n```php\naddImageLabel(string $path, int $row = null, int $col = null): void\n```\n\n```php\n$template-\u003eaddImageLabel(\"https://api.placeholder.app/image/350x350/.png\");\n```\n\n### Custom Labels\n\nThe `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.\n\n```php\naddCustomLabel(LabelInterface $label): void\n```\n\nThe custom label must implement the `LabelInterface` interface. See [/src/LabelInterface.php](/src/LabelInterface.php) for more information.\n\n# Requirements \u0026 Dependencies\n\n- FPDF 1.81 Minimum [http://www.fpdf.org/]\n- PHP 7.4+ [https://php.net]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famattu2%2Favery-fpdf-labels","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famattu2%2Favery-fpdf-labels","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famattu2%2Favery-fpdf-labels/lists"}