{"id":18315544,"url":"https://github.com/mathieutu/laravel-pdflayer","last_synced_at":"2025-04-05T20:32:37.471Z","repository":{"id":52420556,"uuid":"77931503","full_name":"mathieutu/laravel-pdflayer","owner":"mathieutu","description":"A pdflayer API bridge for Laravel.","archived":false,"fork":false,"pushed_at":"2021-04-29T19:29:08.000Z","size":30,"stargazers_count":6,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-21T09:51:07.741Z","etag":null,"topics":["composer","laravel","pdf","pdf-converter","pdflayer","pdflayer-bridge","php"],"latest_commit_sha":null,"homepage":"","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/mathieutu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-03T15:57:14.000Z","updated_at":"2019-02-05T16:33:30.000Z","dependencies_parsed_at":"2022-09-15T13:23:16.265Z","dependency_job_id":null,"html_url":"https://github.com/mathieutu/laravel-pdflayer","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathieutu%2Flaravel-pdflayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathieutu%2Flaravel-pdflayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathieutu%2Flaravel-pdflayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathieutu%2Flaravel-pdflayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathieutu","download_url":"https://codeload.github.com/mathieutu/laravel-pdflayer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399818,"owners_count":20932875,"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":["composer","laravel","pdf","pdf-converter","pdflayer","pdflayer-bridge","php"],"created_at":"2024-11-05T16:41:31.994Z","updated_at":"2025-04-05T20:32:37.170Z","avatar_url":"https://github.com/mathieutu.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## PDFLayer API bridge for Laravel 5.5+ (for 5.2+ take the 1.* version)\n[pdflayer.com](https://pdflayer.com) is an HTML to PDF conversion API for developers. \nThis package is an unofficial bridge to use this api with the PHP Laravel framework.\n\n[![Travis build](https://img.shields.io/travis/mathieutu/laravel-pdflayer/master.svg?style=flat-square\u0026label=Build)](https://travis-ci.org/mathieutu/laravel-pdflayer?branch=master) \n[![StyleCI](https://styleci.io/repos/77931503/shield?branch=master)](https://styleci.io/repos/77931503) \n[![Test coverage](https://img.shields.io/scrutinizer/coverage/g/mathieutu/laravel-pdflayer.svg?style=flat-square\u0026label=Coverage)](https://scrutinizer-ci.com/g/mathieutu/laravel-pdflayer/?branch=master) \n[![Code quality](https://img.shields.io/scrutinizer/g/mathieutu/laravel-pdflayer.svg?style=flat-square\u0026label=Quality)](https://scrutinizer-ci.com/g/mathieutu/laravel-pdflayer/?branch=master) \n[![Packagist downloads](https://img.shields.io/packagist/dt/mathieutu/laravel-pdflayer.svg?style=flat-square\u0026label=Downloads)](https://packagist.org/packages/mathieutu/laravel-pdflayer)\n[![Stable version](https://img.shields.io/packagist/v/mathieutu/laravel-pdflayer.svg?style=flat-square\u0026label=Packagist)](https://packagist.org/packages/mathieutu/laravel-pdflayer)\n\n## Installation\n\nRequire this package in your composer.json and update composer.\n```bash\ncomposer require mathieutu/laravel-pdflayer\n```\n \n## Usage\n\nYou can create a new PDFLayer instance and load a HTML string, file, view name or even an url. \nYou can save it to a file, stream (show in browser) or download.\n\nTo create an new instance, you can use the `App` class, the `app()` helper, use the [facade](https://laravel.com/docs/5.5/facades), or (better) use [automatic dependency injection](https://laravel.com/docs/5.5/controllers#dependency-injection-and-controllers) :\n```php\n$pdf = App::make('pdflayer');\n$pdf = app('pdflayer');\n$pdf = PDF::anyMethod();\npublic function downloadPdf(MathieuTu\\PDFLayer\\PDF $pdf) {}\n```\nYou can chain the methods:\n```php\nreturn $pdf-\u003eloadView('pdf.invoice', $data)-\u003esetPaper('a4', 'landscape')-\u003esave('/path-to/my_stored_file.pdf')-\u003estream('download.pdf');\n```\nYou can set all the parameters given by the [pdflayer documentation](https://pdflayer.com/documentation) by using the `setXXX` method where XXX is the parameter in StudlyCase, or just set the parameter (in original snake_case) as attribute of the object.\n```php\n$pdf-\u003eloadHTML('\u003ch1\u003eHello!\u003c/h1\u003e')-\u003esetWatermarkInBackground(true);\n$pdf-\u003emargin_top = 134;\n$pdf-\u003esave('myfile.pdf');\n```\nIf you need the output as a string, you can get the rendered PDF with the output() function, so you can directly send it by email, for example.\n\n### Configuration\nThe defaults configuration settings are set in `config/pdflayer.php`. Copy this file to your own config directory to modify the values. You can publish the config using this shell command:\n```bash\nphp artisan vendor:publish --provider=\"MathieuTu\\PDFLayer\\PDFLayerServiceProvider\"\n```\n    \n### License and thanks\n\nThis PDFLayer Bridge for Laravel is an open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).\n\nThe developer is not affiliated in any way with the [pdflayer.com](https://pdflayer.com) service.\n\nThis Readme and some methods of the `PDF` class are adapted from the [barryvdh/laravel-dompdf](https://github.com/barryvdh/laravel-dompdf) package. Thanks to him for his job.\n\n\n### Contributing\n\nIssues and PRs are obviously welcomed and encouraged, as well for new features than documentation.\nEach piece of code added should be fully tested, but we can do that all together, so please don't be afraid by that. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathieutu%2Flaravel-pdflayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathieutu%2Flaravel-pdflayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathieutu%2Flaravel-pdflayer/lists"}