{"id":17652456,"url":"https://github.com/elibyy/tcpdf-laravel","last_synced_at":"2025-05-14T12:07:57.566Z","repository":{"id":41186803,"uuid":"51472243","full_name":"elibyy/tcpdf-laravel","owner":"elibyy","description":"TCPDF helper for laravel","archived":false,"fork":false,"pushed_at":"2025-03-31T07:37:18.000Z","size":106,"stargazers_count":337,"open_issues_count":17,"forks_count":74,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-13T06:15:13.363Z","etag":null,"topics":["laravel","pdf","php"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elibyy.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":"2016-02-10T21:07:37.000Z","updated_at":"2025-04-10T11:46:30.000Z","dependencies_parsed_at":"2023-11-19T15:31:50.462Z","dependency_job_id":"6f60ef09-ac51-4dbd-af69-ccfc072508ba","html_url":"https://github.com/elibyy/tcpdf-laravel","commit_stats":{"total_commits":67,"total_committers":15,"mean_commits":4.466666666666667,"dds":0.7611940298507462,"last_synced_commit":"eddd210c1597b696abd0dd1401a2e21672ee415e"},"previous_names":[],"tags_count":82,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elibyy%2Ftcpdf-laravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elibyy%2Ftcpdf-laravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elibyy%2Ftcpdf-laravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elibyy%2Ftcpdf-laravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elibyy","download_url":"https://codeload.github.com/elibyy/tcpdf-laravel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670434,"owners_count":21142904,"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":["laravel","pdf","php"],"created_at":"2024-10-23T11:47:03.795Z","updated_at":"2025-04-13T06:15:18.900Z","avatar_url":"https://github.com/elibyy.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel 6-7-8-9-10-11-12 TCPDF\n[![Latest Stable Version](https://poser.pugx.org/elibyy/tcpdf-laravel/v/stable)](https://packagist.org/packages/elibyy/tcpdf-laravel) [![Total Downloads](https://poser.pugx.org/elibyy/tcpdf-laravel/downloads)](https://packagist.org/packages/elibyy/tcpdf-laravel) [![Latest Unstable Version](https://poser.pugx.org/elibyy/tcpdf-laravel/v/unstable)](https://packagist.org/packages/elibyy/tcpdf-laravel) [![License](https://poser.pugx.org/elibyy/tcpdf-laravel/license)](https://packagist.org/packages/elibyy/tcpdf-laravel)\n\nA simple [Laravel](http://www.laravel.com) service provider with some basic configuration for including the [TCPDF library](http://www.tcpdf.org/)\n\n#### TCPDF is not really supported in PHP 7 but there's a plan for supporting it, check [this](https://github.com/tecnickcom/tc-lib-pdf) out.\n\n## Installation\n\nThe Laravel TCPDF service provider can be installed via [composer](http://getcomposer.org) by requiring the `elibyy/tcpdf-laravel` package in your project's `composer.json`. (The installation may take a while, because the package requires TCPDF. Sadly its .git folder is very heavy)\n\n```\ncomposer require elibyy/tcpdf-laravel\n```\n\nor\n\nLaravel 5.5+ will use the auto-discovery function.\n\n```json\n{\n    \"require\": {\n        \"elibyy/tcpdf-laravel\": \"^9.0\"\n    }\n}\n```\n\nIf you don't use auto-discovery you will need to include the service provider / facade in `config/app.php`.\n\n\n```php\n'providers' =\u003e [\n    //...\n    Elibyy\\TCPDF\\ServiceProvider::class,\n]\n\n//...\n\n'aliases' =\u003e [\n    //...\n    'PDF' =\u003e Elibyy\\TCPDF\\Facades\\TCPDF::class\n]\n```\n\n(Please note: TCPDF cannot be used as an alias)\n\nfor lumen you should add the following lines:\n\n```php\n$app-\u003eregister(Elibyy\\TCPDF\\ServiceProvider::class);\nclass_alias(Elibyy\\TCPDF\\Facades\\TCPDF::class, 'PDF');\n```\n\nThat's it! You're good to go.\n\nHere is a little example:\n\n```php\nuse PDF; // at the top of the file\n\n  PDF::SetTitle('Hello World');\n  PDF::AddPage();\n  PDF::Write(0, 'Hello World');\n  PDF::Output('hello_world.pdf');\n```\n\nanother example for generating multiple PDF's\n\n```php\nuse PDF; // at the top of the file\n\n  for ($i = 0; $i \u003c 5; $i++) {\n    PDF::SetTitle('Hello World'.$i);\n    PDF::AddPage();\n    PDF::Write(0, 'Hello World'.$i);\n    PDF::Output(public_path('hello_world' . $i . '.pdf'), 'F');\n    PDF::reset();\n  }\n```\n\nFor a list of all available function take a look at the [TCPDF Documentation](http://www.tcpdf.org/doc/code/classTCPDF.html)\n\n## Configuration\n\nLaravel-TCPDF comes with some basic configuration.\nIf you want to override the defaults, you can publish the config, like so:\n\n    php artisan vendor:publish --provider=\"Elibyy\\TCPDF\\ServiceProvider\"\n\nNow access `config/tcpdf.php` to customize.\n\n * use_original_header is to used the original `Header()` from TCPDF.\n    * Please note that `PDF::setHeaderCallback(function($pdf){})` overrides this settings.\n * use_original_footer is to used the original `Footer()` from TCPDF.\n    * Please note that `PDF::setFooterCallback(function($pdf){})` overrides this settings.\n * use_fpdi is so that our internal helper will extend `TcpdfFpdi` instead of `TCPDF`.\n    * Please note fpdi is not a dependency in my project so you will have to follow their install instructions [here](https://github.com/Setasign/FPDI)\n\n## Header/Footer helpers\n\nI've got a pull-request asking for this so I've added the feature\n\nnow you can use `PDF::setHeaderCallback(function($pdf){})` or `PDF::setFooterCallback(function($pdf){})`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felibyy%2Ftcpdf-laravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felibyy%2Ftcpdf-laravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felibyy%2Ftcpdf-laravel/lists"}