{"id":19451688,"url":"https://github.com/akki-io/html2pdf","last_synced_at":"2025-04-25T04:30:29.468Z","repository":{"id":124834155,"uuid":"365895388","full_name":"akki-io/html2pdf","owner":"akki-io","description":"Microservice for generating PDF's from HTML or URL","archived":false,"fork":false,"pushed_at":"2023-05-15T14:29:42.000Z","size":160,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-03T15:52:29.699Z","etag":null,"topics":["cloud-run","docker","lumen","microservice","php","serverless","wkhtmltopdf"],"latest_commit_sha":null,"homepage":"https://html2pdf.akki.ca/?preview=1\u0026url=https://en.wikipedia.org/wiki/Main_Page","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/akki-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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":"2021-05-10T02:26:27.000Z","updated_at":"2024-12-14T08:33:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"8e4abc61-eee5-4aa2-a15d-2d6b3e0a0484","html_url":"https://github.com/akki-io/html2pdf","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/akki-io%2Fhtml2pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akki-io%2Fhtml2pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akki-io%2Fhtml2pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akki-io%2Fhtml2pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akki-io","download_url":"https://codeload.github.com/akki-io/html2pdf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250754533,"owners_count":21481832,"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":["cloud-run","docker","lumen","microservice","php","serverless","wkhtmltopdf"],"created_at":"2024-11-10T16:42:40.847Z","updated_at":"2025-04-25T04:30:29.462Z","avatar_url":"https://github.com/akki-io.png","language":"PHP","readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://cdn.akki.ca/html2pdf-bg-dim.png\" alt=\"Hero\"\u003e\n\u003c/p\u003e\n\n# html2pdf microservice\n\nhtml2pdf is a small microservice build using the [lumen](https://lumen.laravel.com/) framework. It utilizes [wkhtmltopdf](https://wkhtmltopdf.org/) for generating pdfs.\n\nThe microservice comes as a docker image, and it can be hosted on services that support docker images. The demo is serverless and run on Google Cloud Run.\n\n[![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run/?git_repo=https://github.com/akki-io/html2pdf)\n\n## Demo\n1. Preview PDF from HTML - [Click Here](https://html2pdf.akki.ca/?preview=1\u0026html=%3Clink%20href=%22https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css%22%20rel=%22stylesheet%22%3E%3Ccenter%3E%3Cimg%20src=%22https://cdn.akki.ca/html2pdf-black.png%22%3E%3Ch1%20class=%22mt-5%22%3EThis%20PDF%20Generated%20using%20html2pdf%3C/h1%3E%3Cp%20class=%22lead%20mt-5%22%3ETo%20learn%20more%20%3Ca%20target=%22_blank%22%20href=%22https://github.com/akki-io/html2pdf%22%3Eclick%20here%3C/a%3E%3C/p%3E%3C/center%3E)\n2. Preview PDF from URL - [Click Here](https://html2pdf.akki.ca/?preview=1\u0026url=https://en.wikipedia.org/wiki/Main_Page)\n3. Download PDF from HTML - [Click Here](https://html2pdf.akki.ca/?filename=custom-html.pdf\u0026html=%3Clink%20href=%22https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css%22%20rel=%22stylesheet%22%3E%3Ccenter%3E%3Cimg%20src=%22https://cdn.akki.ca/html2pdf-black.png%22%3E%3Ch1%20class=%22mt-5%22%3EThis%20PDF%20Generated%20using%20html2pdf%3C/h1%3E%3Cp%20class=%22lead%20mt-5%22%3ETo%20learn%20more%20%3Ca%20target=%22_blank%22%20href=%22https://github.com/akki-io/html2pdf%22%3Eclick%20here%3C/a%3E%3C/p%3E%3C/center%3E)\n4. Download PDF from URL - [Click Here](https://html2pdf.akki.ca/?filename=wikipedia.pdf\u0026url=https://en.wikipedia.org/wiki/Main_Page)\n\n## Run Locally using Docker\n\n1. Run the docker image `docker run -it -rm -p 9091:80 gcr.io/akki-ca/html2pdf`\n2. Visit `localhost:9091/status`\n\n## Add the service to your `docker-compose.yml` file\n\nYou can also add the service to your docker-composer file. \n\n```shell\n    html2pdf:\n        image: gcr.io/akki-ca/html2pdf\n        ports:\n            - \"9091:80\"\n```\n\n## API Documentation\n\n### Status\n\nGet the status of the microservice\n\n#### `GET` `/status`\n\n#### Response\n\n```json\n{\n    \"message\": \"Request successfully completed.\"\n}\n```\n\n### Convert HTML or URL to PDF\n\n#### `GET|POST` `/`\n\n#### Params\n\n| Name | Type | Nullable | Description |\n| ----------- | ----------- | ----------- | ----------- |\n| url | url | Y | The url that needs to be converted to pdf. |\n| html | string | Y/N | It is required if `url` is null or not present. |\n| options | array | Y | wkhtmltopdf options - ref [here](https://wkhtmltopdf.org/usage/wkhtmltopdf.txt) |\n| preview | boolean | Y | If set to 1 you will return a preview of the generated pdf |\n| filename | string | Y | Set the filename of the pdf that will be downloaded |\n\n#### Response\n\nIf the request is successful the response will return a preview of the pdf file or as a download depending on the request parameters.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security\n\nIf you discover any security related issues, please email hello@akki.io instead of using the issue tracker.\n\n## Credits\n\n- [Akki Khare](https://github.com/akki-io)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n## References\n- [Lumen](https://lumen.laravel.com/)\n- [wkhtmltopdf](https://wkhtmltopdf.org/)\n- [laravel-snappy](https://github.com/barryvdh/laravel-snappy)\n- [Cloud Run](https://cloud.google.com/run)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakki-io%2Fhtml2pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakki-io%2Fhtml2pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakki-io%2Fhtml2pdf/lists"}