{"id":14983641,"url":"https://github.com/hanishsingla/mpdf-wrapper","last_synced_at":"2026-01-03T06:13:08.501Z","repository":{"id":57063623,"uuid":"86420026","full_name":"hanishsingla/mpdf-wrapper","owner":"hanishsingla","description":null,"archived":false,"fork":false,"pushed_at":"2019-03-27T12:11:54.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-23T00:11:19.904Z","etag":null,"topics":["mpdf","symfony","symfony-bundle","symfony2","symfony3","wrapper"],"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/hanishsingla.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}},"created_at":"2017-03-28T05:49:59.000Z","updated_at":"2019-03-27T12:08:26.000Z","dependencies_parsed_at":"2022-08-24T14:01:23.683Z","dependency_job_id":null,"html_url":"https://github.com/hanishsingla/mpdf-wrapper","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/hanishsingla%2Fmpdf-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanishsingla%2Fmpdf-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanishsingla%2Fmpdf-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanishsingla%2Fmpdf-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hanishsingla","download_url":"https://codeload.github.com/hanishsingla/mpdf-wrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243864822,"owners_count":20360360,"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":["mpdf","symfony","symfony-bundle","symfony2","symfony3","wrapper"],"created_at":"2024-09-24T14:07:43.182Z","updated_at":"2026-01-03T06:13:08.473Z","avatar_url":"https://github.com/hanishsingla.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mpdf-wrapper\n\nThis bundle provides a service for mpdf library with symfony 4.\n\n\n## 1 Installation\u003ca name=\"p_1\"\u003e\u003c/a\u003e\n\n### 1.1 Download MpdfWrapperBundle using composer\u003ca name=\"p_1_1\"\u003e\u003c/a\u003e\n\nRun in terminal:\n```bash\n$ php composer.phar require symfgenus/mpdf-wrapper\n```\n\n### 1.2 Enable the bundle\u003ca name=\"p_1_2\"\u003e\u003c/a\u003e\n\nSymfony flex activates the bundles automatically. If it is not, then enable the bundle:\n```php\n// /config/bundles.php\n\n    [\n        // ...\n        Symfgenus\\MpdfWrapper\\MpdfWrapperBundle::class =\u003e ['all' =\u003e true],\n    ];\n```\n\n## 2 Usage\u003ca name=\"p_2\"\u003e\u003c/a\u003e\n\nMpdfService provides many ways to use MPDF.\n\n### 2.1 It can generate a direct pdf response which can be served through any route.\n\n```php\n// /config/bundles.php\n\n    public function index(MpdfService $MpdfService)\n    {\n        return $MpdfService-\u003egeneratePdfResponse($pdfHtml);\n    }\n```\n\n### 2.2 It can also generate pdf content which can be saved in a variable and used.\n\n```php\n// /config/bundles.php\n\n    public function index(MpdfService $MpdfService)\n    {\n        return $pdf = $MpdfService-\u003egeneratePdf($pdfHtml);\n    }\n```\n\n### 2.3 Sometimes there is need to create multiple PDFs, MpdfService can be used as following:\n\n```php\n// /config/bundles.php\n\n    public function index(MpdfService $MpdfService)\n    {\n        $firstPdf = $MpdfService-\u003egetMpdf($argsFirst);\n        $mpdf-\u003eWriteHTML($htmlFirst);\n        $firstPdfFile = $mpdf-\u003eOutput();\n\n        $secondPdf = $MpdfService-\u003egetMpdf($argsSecond);\n        $mpdf-\u003eWriteHTML($htmlSecond);\n        $secondPdfFile = $mpdf-\u003eOutput();\n\n        return [\n            $firstPdfFile,\n            $secondPdfFile\n        ];\n    }\n```\n\n## 3 Usage for symfony 3\u003ca name=\"p_2\"\u003e\u003c/a\u003e\n\nFor symfony 3, this service can be loaded as following:\n\n```php\n$this-\u003eget('symfgenus.mpdf.wrapper').\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanishsingla%2Fmpdf-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhanishsingla%2Fmpdf-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanishsingla%2Fmpdf-wrapper/lists"}