{"id":33980845,"url":"https://github.com/biaoqianwo/php-htmltopdf-htmltoimage","last_synced_at":"2025-12-13T03:30:32.180Z","repository":{"id":62493954,"uuid":"101845460","full_name":"biaoqianwo/php-htmltopdf-htmltoimage","owner":"biaoqianwo","description":"transfer html to pdf or image","archived":false,"fork":false,"pushed_at":"2017-08-30T09:35:07.000Z","size":13,"stargazers_count":12,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-03T21:53:01.918Z","etag":null,"topics":["html2image","html2pdf","htmltoimage","htmltopdf","php","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/biaoqianwo.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-08-30T06:24:39.000Z","updated_at":"2024-08-04T13:32:31.000Z","dependencies_parsed_at":"2022-11-02T11:17:54.406Z","dependency_job_id":null,"html_url":"https://github.com/biaoqianwo/php-htmltopdf-htmltoimage","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/biaoqianwo/php-htmltopdf-htmltoimage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biaoqianwo%2Fphp-htmltopdf-htmltoimage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biaoqianwo%2Fphp-htmltopdf-htmltoimage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biaoqianwo%2Fphp-htmltopdf-htmltoimage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biaoqianwo%2Fphp-htmltopdf-htmltoimage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/biaoqianwo","download_url":"https://codeload.github.com/biaoqianwo/php-htmltopdf-htmltoimage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biaoqianwo%2Fphp-htmltopdf-htmltoimage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27699626,"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","status":"online","status_checked_at":"2025-12-13T02:00:09.769Z","response_time":147,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["html2image","html2pdf","htmltoimage","htmltopdf","php","wkhtmltopdf"],"created_at":"2025-12-13T03:30:31.626Z","updated_at":"2025-12-13T03:30:32.166Z","avatar_url":"https://github.com/biaoqianwo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-htmltopdf-htmltoimage\nTransfer html to pdf or image using wkhtmltopdf.\n\n## Requirements\n\n### PHP7\n\n###wkhtmltopdf\n\n```\ncd /tmp\nwget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz\ntar xf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz \u0026\u0026 rm wkhtmltox-0.12.4_linux-generic-amd64.tar.xz\nln -s -T /tmp/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf \u0026\u0026 \\\nchmod a+x /usr/local/bin/wkhtmltopdf \u0026\u0026  \\\nln -s -T /tmp/wkhtmltox/bin/wkhtmltoimage /usr/local/bin/wkhtmltoimage \u0026\u0026 \\\nchmod a+x /usr/local/bin/wkhtmltoimage\n```\nCheck and get help by `wkhtmltopdf -h` or `wkhtmltoimage -h`  \nMore information to see: https://wkhtmltopdf.org/\n\n## Install\n\n`composer require biaoqianwo/php-htmltopdf-htmltoimage`\n\n## Quick Start and Examples\n\n```\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse \\Biaoqianwo\\Html2Pdf\\Html2Pdf;\nuse \\Biaoqianwo\\Html2Pdf\\Html2Image;\n\n$html = '\u003chtml\u003e\u003chead\u003e\u003ctitle\u003eexport\u003c/title\u003e......';\n// or \n// $html = file_get_contents('http://google.com');\n\n// Pdf\n$generator = new Html2Pdf('/usr/local/bin/wkhtmltopdf');\n$options = ['header'=\u003e'Centered header text','footer'=\u003e'Left aligned footer text'];\n$generator-\u003egetOutputFromHtml($html, $options)\n\n// Image\n$generator = new Html2Image('/usr/local/bin/wkhtmltoimage');\n$options = ['format'=\u003e'png','width'=\u003e'300','height'=\u003e'1000'];\n$generator-\u003egetOutputFromHtml($html, $options)\n```\n\n## More\nYou can improve `getHeader()` 、 `getFooter()`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiaoqianwo%2Fphp-htmltopdf-htmltoimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiaoqianwo%2Fphp-htmltopdf-htmltoimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiaoqianwo%2Fphp-htmltopdf-htmltoimage/lists"}