{"id":24054513,"url":"https://github.com/refaltor77/easypdf","last_synced_at":"2026-04-28T16:05:51.529Z","repository":{"id":270119170,"uuid":"909399482","full_name":"Refaltor77/EasyPDF","owner":"Refaltor77","description":"A very easy-to-use library that allows you to generate PDFs from Blade views with minimal effort.","archived":false,"fork":false,"pushed_at":"2024-12-28T15:37:55.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-09T03:47:25.216Z","etag":null,"topics":["blade-template","composer-package","easy-pdf","laravel","laravel-package","library","mpdf","open-source","pdf","pdf-document","pdf-generation","pdf-viewer","php","php-library","template-engin"],"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/Refaltor77.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":"2024-12-28T15:34:48.000Z","updated_at":"2025-01-01T13:00:33.000Z","dependencies_parsed_at":"2024-12-28T18:03:01.102Z","dependency_job_id":null,"html_url":"https://github.com/Refaltor77/EasyPDF","commit_stats":null,"previous_names":["refaltor77/easypdf"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Refaltor77%2FEasyPDF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Refaltor77%2FEasyPDF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Refaltor77%2FEasyPDF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Refaltor77%2FEasyPDF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Refaltor77","download_url":"https://codeload.github.com/Refaltor77/EasyPDF/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240840044,"owners_count":19866164,"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":["blade-template","composer-package","easy-pdf","laravel","laravel-package","library","mpdf","open-source","pdf","pdf-document","pdf-generation","pdf-viewer","php","php-library","template-engin"],"created_at":"2025-01-09T03:47:26.740Z","updated_at":"2026-04-28T16:05:51.488Z","avatar_url":"https://github.com/Refaltor77.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EasyPdf\n\n`EasyPdf` is a library that enables the creation of PDFs using Blade templates and the Mpdf library. It provides an easy-to-use interface for generating PDFs from Blade views, with options for saving or streaming the generated PDF.\n\n## Features\n\n- **Blade Template Integration**: Use Blade templates to generate HTML content for PDFs.\n- **Mpdf Integration**: Leverage Mpdf for high-performance PDF generation.\n- **Save or Stream PDFs**: Save PDFs to a file or stream them directly to the browser.\n\n## Installation\n\nYou can install the package via Composer:\n\n```bash\ncomposer require elysio/easy-pdf\n``` \n\n## Usage\n\n### Initialize the EasyPdf instance\n\nTo initialize the `EasyPdf` class, you can either use the constructor directly or the static `init` method.\n\n```php\nuse elysio\\easypdf\\EasyPdf;\n\n$pdfGenerator = EasyPdf::init('path/to/views', 'path/to/cache');\n``` \n\n### Generate a PDF\n\nYou can generate a PDF from a Blade view by calling the `makePdf` method. The method takes the name of the Blade view and an optional array of data to be passed to the view.\n\n```php\n$pdf = $pdfGenerator-\u003emakePdf('viewName', ['key' =\u003e 'value']);\n```\n\nThis will return an `Mpdf` instance, which you can use for further operations (e.g., saving or streaming the PDF).\n\n### Save the PDF\n\nTo save the generated PDF to a file, use the `savePdf` method:\n\n```php\n$success = $pdfGenerator-\u003esavePdf($pdf, 'path/to/save/document.pdf');\n```\n\n### Stream the PDF\n\nTo stream the generated PDF directly to the browser, use the `streamPdf` method:\n\n```php\n$pdfGenerator-\u003estreamPdf($pdf, 'document.pdf');\n```\n\n## Configuration\n\nThe `EasyPdf` class allows you to specify custom paths for the Blade views and cache directories when initializing the instance.\n\n```php\n$pdfGenerator = EasyPdf::init('custom/views', 'custom/cache');\n```\n\n## Dependencies\n\n- **mpdf/mpdf**: Required for PDF generation.\n- **eftec/bladeone**: Required for Blade templating.\n\n## Development\n\nTo run tests during development, use the following command:\n\n```bash\ncomposer test\n```\n\nThis will execute the tests using Pest.\n\n## License\n\nMIT License. See the [LICENSE](LICENSE) file for more information.\n\n## Author\n\n**Elysio Martins | Refaltor** \u003cbr/\u003e\nEmail: [elysiomartinspro@gmail.com](mailto:elysiomartinspro@gmail.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefaltor77%2Feasypdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frefaltor77%2Feasypdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefaltor77%2Feasypdf/lists"}