{"id":20512123,"url":"https://github.com/jmleroux/pdf-merger","last_synced_at":"2025-04-13T22:43:01.658Z","repository":{"id":57000334,"uuid":"260144617","full_name":"jmleroux/pdf-merger","owner":"jmleroux","description":"PDF merger for PHP 7","archived":false,"fork":false,"pushed_at":"2020-04-30T07:58:08.000Z","size":1240,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T14:49:16.917Z","etag":null,"topics":["fpdf","pdf-generation","tcpdf"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmleroux.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-30T07:37:57.000Z","updated_at":"2022-11-21T03:04:09.000Z","dependencies_parsed_at":"2022-08-21T13:51:01.095Z","dependency_job_id":null,"html_url":"https://github.com/jmleroux/pdf-merger","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmleroux%2Fpdf-merger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmleroux%2Fpdf-merger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmleroux%2Fpdf-merger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmleroux%2Fpdf-merger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmleroux","download_url":"https://codeload.github.com/jmleroux/pdf-merger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248794566,"owners_count":21162613,"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":["fpdf","pdf-generation","tcpdf"],"created_at":"2024-11-15T20:40:00.566Z","updated_at":"2025-04-13T22:43:01.627Z","avatar_url":"https://github.com/jmleroux.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PDFMerger for PHP 7\n\nOriginal written by http://pdfmerger.codeplex.com/team/view\n\nForked from https://github.com/clegginabox/pdf-merger\n\n## Installation\n\n```composer require jmleroux/pdf-merger```\n\n## Example Usage\n\n```php\n\u003c?php\nuse Jmleroux\\PDFMerger\\PDFMerger;\n\n$pdf = new PDFMerger();\n\n$pdf-\u003eaddPDF('samplepdfs/one.pdf', '1, 3, 4');\n$pdf-\u003eaddPDF('samplepdfs/two.pdf', '1-2');\n$pdf-\u003eaddPDF('samplepdfs/three.pdf', 'all');\n\n//You can optionally specify a different orientation for each PDF\n$pdf-\u003eaddPDF('samplepdfs/one.pdf', '1, 3, 4', 'L');\n$pdf-\u003eaddPDF('samplepdfs/two.pdf', '1-2', 'P');\n\n$pdf-\u003emerge('file', 'samplepdfs/TEST2.pdf', 'P');\n```\n\n### PDF libraries\n\nYou can use either FPDF, TCPDF or tFPDF as the internal PDF library\nby providing the right parameter to the constructor:\n \n```php\n\u003c?php\nuse Jmleroux\\PDFMerger\\PDFMerger;\n\n$pdf = new PDFMerger(); // use FPDF\n$pdf = new PDFMerger('fpdf'); // use FPDF\n\n$pdf = new PDFMerger('tcpdf'); // use TCPDF\n\n$pdf = new PDFMerger('tfpdf'); // use tFPDF\n```\n\n### Output modes\n\nThis merger uses verbose parameter names for the various pdf output modes common to the three libraries:\n \n* `browser` (default): send the pdf binary to the browser. The borwser PDF plug-in is used if available.\n* `download`: send the pdf to the browser and force a file download with the name given.\n* `string`: outputs the raw binary string.\n* `file`: save to a local server file with the name given.\n\n## Development\n\nThis repo is shipped with a docker-compose file so that you don't need a local version of PHP.\n\nUse make commands to install and run tests:\n\nTo install dependencies:\n\n```\nmake vendor\n```\n\nTo run tests:\n\n```\nmake tests\n```\n\n### WTF?\n\nYes, why the fork?\n\nI first made a PR to fix the \"slice feature\", but I figured out I wanted a library with tests and tags.\nPlus, I wanted to add docker-compose because I do not have any local PHP installed anymore,\nso I decided to fork it and start with PHP 7. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmleroux%2Fpdf-merger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmleroux%2Fpdf-merger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmleroux%2Fpdf-merger/lists"}