{"id":23397542,"url":"https://github.com/leocode/puppeteer-service","last_synced_at":"2025-10-29T16:32:02.014Z","repository":{"id":45578610,"uuid":"351765251","full_name":"leocode/puppeteer-service","owner":"leocode","description":"Containerized Puppeteer which allows to render images and PDFs of given webpage or HTML code","archived":false,"fork":false,"pushed_at":"2021-12-07T13:43:08.000Z","size":195,"stargazers_count":2,"open_issues_count":5,"forks_count":4,"subscribers_count":15,"default_branch":"main","last_synced_at":"2024-12-22T08:19:03.453Z","etag":null,"topics":["docker","pdf","puppeteer","screenshot"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/leocode.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":"2021-03-26T11:52:06.000Z","updated_at":"2022-10-25T17:05:23.000Z","dependencies_parsed_at":"2022-07-26T12:01:58.015Z","dependency_job_id":null,"html_url":"https://github.com/leocode/puppeteer-service","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leocode%2Fpuppeteer-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leocode%2Fpuppeteer-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leocode%2Fpuppeteer-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leocode%2Fpuppeteer-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leocode","download_url":"https://codeload.github.com/leocode/puppeteer-service/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238853900,"owners_count":19541739,"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":["docker","pdf","puppeteer","screenshot"],"created_at":"2024-12-22T08:19:10.244Z","updated_at":"2025-10-29T16:31:56.703Z","avatar_url":"https://github.com/leocode.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# puppeteer-service\n\nContainerized Puppeteer which allows to render images and PDFs of given webpage or HTML code\n\n## Quick start - start container, convert HTML to PDF\n\nFor production: **Remember to select precise version tag for the image (e.g. leocode/puppeteer-service:1.1.0)**\n\n```sh\ndocker build -t pup-test leocode/puppeteer-service\n\ndocker run -it --rm -p 3000:3000 pup-test\n\ncurl -d '{\"html\":\"\u003cstrong\u003eHello world\u003c/strong\u003e\"}' -H \"Content-Type: application/json\" -X POST http://localhost:3000/html/pdf \u003e hello-world.pdf\n```\n\n## Container installation\n\n**Remember to select precise version tag for the image (e.g. leocode/puppeteer-service:1.1.0)**\n\n```\ndocker run leocode/puppeteer-service\n```\n\nThe same can be used for docker-compose:\n\n```yaml\nservices:\n  puppeteer:\n    image: leocode/puppeteer-service\n```\n\n## Documentation\n\nStarting container automatically starts API server.\n\nIt listens on port 3000.\n\n### HTML to PDF\n\n**Method**: `POST`\n\n**URL**: `/html/pdf`\n\n**Body**\n\n```json\n{\n  \"html\": \"\u003chtml\u003e\u003chead\u003e\u003cstyle\u003e\u003c/style\u003e\u003c/head\u003e\u003cbody\u003eContent\u003c/body\u003e\u003c/html\u003e\"\n}\n```\n\n**Response**\n\n```\nHTTP/1.1 200 OK\ncontent-type: application/octet-stream\n\n\u003cbinary\u003e\n```\n\n### HTML to PNG\n\n**Method**: `POST`\n\n**URL**: `/html/png`\n\n**Body**\n\n```json\n{\n  \"html\": \"\u003chtml\u003e\u003chead\u003e\u003cstyle\u003e\u003c/style\u003e\u003c/head\u003e\u003cbody\u003eContent\u003c/body\u003e\u003c/html\u003e\",\n  \"viewport\": {\n    \"width\": 1024,\n    \"height\": 768\n  }\n}\n```\n\n**Response**\n\n```\nHTTP/1.1 200 OK\ncontent-type: application/octet-stream\n\n\u003cbinary\u003e\n```\n\n### URL to PDF\n\n**Method**: `POST`\n\n**URL**: `/url/pdf`\n\n**Body**\n\n```json\n{\n  \"url\": \"https://www.wikipedia.org/\"\n}\n```\n\n**Response**\n\n```\nHTTP/1.1 200 OK\ncontent-type: application/octet-stream\n\n\u003cbinary\u003e\n```\n\n### URL to PNG\n\n**Method**: `POST`\n\n**URL**: `/url/png`\n\n**Body**\n\n```json\n{\n  \"url\": \"https://www.wikipedia.org/\",\n  \"viewport\": {\n    \"width\": 1024,\n    \"height\": 768\n  }\n}\n```\n\n**Response**\n\n```\nHTTP/1.1 200 OK\ncontent-type: application/octet-stream\n\n\u003cbinary\u003e\n```\n\n## Development\n\nDependencies:\n\n- Docker\n\n```\nyarn start:dev\n```\n\nStart container with API. Wait until logs from server appear (due to one-line command `docker build` output is muted). It may take up to few minutes. Consecutive starts (after code change) should be faster.\n\nYou can test production build using\n\n```\nyarn start:prod\n```\n\n### Versioning\n\nWe use semver for versioning. Release should be tagged with vX.Y.Z, so the version is picked up by Docker Hub autobuild.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleocode%2Fpuppeteer-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleocode%2Fpuppeteer-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleocode%2Fpuppeteer-service/lists"}