{"id":20471011,"url":"https://github.com/cangelis/php-pdf","last_synced_at":"2025-07-12T02:11:54.597Z","repository":{"id":12980904,"uuid":"15659658","full_name":"cangelis/php-pdf","owner":"cangelis","description":"Yet another HTML to PDF Converter based on wkhtmltopdf","archived":false,"fork":false,"pushed_at":"2021-01-08T13:26:46.000Z","size":21,"stargazers_count":53,"open_issues_count":1,"forks_count":19,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-02T07:13:38.274Z","etag":null,"topics":["pdf","php-pdf","wkhtmltopdf"],"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/cangelis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-05T22:10:15.000Z","updated_at":"2024-08-30T15:37:06.000Z","dependencies_parsed_at":"2022-08-31T05:10:56.818Z","dependency_job_id":null,"html_url":"https://github.com/cangelis/php-pdf","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/cangelis/php-pdf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cangelis%2Fphp-pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cangelis%2Fphp-pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cangelis%2Fphp-pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cangelis%2Fphp-pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cangelis","download_url":"https://codeload.github.com/cangelis/php-pdf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cangelis%2Fphp-pdf/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264923811,"owners_count":23683815,"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":["pdf","php-pdf","wkhtmltopdf"],"created_at":"2024-11-15T14:14:41.081Z","updated_at":"2025-07-12T02:11:54.390Z","avatar_url":"https://github.com/cangelis.png","language":"PHP","readme":"# HTML to PDF Converter based on wkhtmltopdf for PHP\n\nThis is a yet another html to pdf converter for php. This package uses [wkhtmltopdf](https://github.com/antialize/wkhtmltopdf) as a third-party tool so `proc_*()` functions have to be enabled in your php configurations and `wkhtmltopdf` tool should be installed in your machine (You can download it from [here](http://wkhtmltopdf.org/)).\n\n## Installation\n\nAdd this to your `composer.json`\n\n    {\n        \"require\": {\n            \"cangelis/pdf\": \"2.2.*\"\n        }\n    }\n\nand run `composer.phar update`\n\n## Some examples\n\n    $pdf = new CanGelis\\PDF\\PDF('/usr/bin/wkhtmltopdf');\n\n    echo $pdf-\u003eloadHTML('\u003cb\u003eHello World\u003c/b\u003e')-\u003eget();\n\n    echo $pdf-\u003eloadURL('http://www.laravel.com')-\u003egrayscale()-\u003epageSize('A3')-\u003eorientation('Landscape')-\u003eget();\n\n    echo $pdf-\u003eloadHTMLFile('/home/can/index.html')-\u003elowquality()-\u003epageSize('A2')-\u003eget();\n\n## Saving the output\n\nphp-pdf uses [League\\Flysystem](https://github.com/thephpleague/flysystem) to save the file to the local or remote filesystems.\n\n### Usage\n\n    $pdfObject-\u003esave(string $filename, League\\Flysystem\\AdapterInterface $adapter, $overwrite)\n\n`filename`: the name of the file you want to save with\n\n`adapter`: FlySystem Adapter\n\n`overwrite`: If set to `true` and the file exists it will be overwritten, otherwise an Exception will be thrown.\n\n### Examples\n\n    // Save the pdf to the local file system\n    $pdf-\u003eloadHTML('\u003cb\u003eHello World\u003c/b\u003e')\n        -\u003esave(\"invoice.pdf\", new League\\Flysystem\\Adapter\\Local(__DIR__.'/path/to/root'));\n\n    // Save to AWS S3\n    $client = S3Client::factory([\n        'key'    =\u003e '[your key]',\n        'secret' =\u003e '[your secret]',\n    ]);\n    $pdf-\u003eloadHTML('\u003cb\u003eHello World\u003c/b\u003e')\n        -\u003esave(\"invoice.pdf\", new League\\Flysystem\\Adapter\\AwsS3($client, 'bucket-name', 'optional-prefix'));\n\n    // Save to FTP\n    $ftpConf = [\n        'host' =\u003e 'ftp.example.com',\n        'username' =\u003e 'username',\n        'password' =\u003e 'password',\n\n        /** optional config settings */\n        'port' =\u003e 21,\n        'root' =\u003e '/path/to/root',\n        'passive' =\u003e true,\n        'ssl' =\u003e true,\n        'timeout' =\u003e 30,\n    ];\n    $pdf-\u003eloadHTML('\u003cb\u003eHello World\u003c/b\u003e')\n        -\u003esave(\"invoice.pdf\", new League\\Flysystem\\Adapter\\Ftp($ftpConf));\n\n    // Save to the multiple locations and echo to the screen\n    echo $pdf-\u003eloadHTML('\u003cb\u003eHello World\u003c/b\u003e')\n            -\u003esave(\"invoice.pdf\", new League\\Flysystem\\Adapter\\Ftp($ftpConf))\n            -\u003esave(\"invoice.pdf\", new League\\Flysystem\\Adapter\\AwsS3($client, 'bucket-name', 'optional-prefix'))\n            -\u003esave(\"invoice.pdf\", new League\\Flysystem\\Adapter\\Local(__DIR__.'/path/to/root'))\n            -\u003eget();\n\nPlease see all the available adapters on the [League\\Flysystem](https://github.com/thephpleague/flysystem)'s documentation\n\n## Documentation\n\nYou can see all the available methods in the full [documentation](https://github.com/cangelis/php-pdf/blob/master/DOCUMENTATION.md) file\n\n## Contribution\n\nFeel free to contribute!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcangelis%2Fphp-pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcangelis%2Fphp-pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcangelis%2Fphp-pdf/lists"}