{"id":23278693,"url":"https://github.com/kavindu-mane/html-to-pdf","last_synced_at":"2026-05-03T01:40:41.659Z","repository":{"id":232617458,"uuid":"784801015","full_name":"kavindu-mane/HTML-To-PDF","owner":"kavindu-mane","description":"Simple API for convert HTML to PDF. This API use puppeteer npm package as convertor. ","archived":false,"fork":false,"pushed_at":"2025-07-19T09:17:59.000Z","size":63,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-29T02:47:58.853Z","etag":null,"topics":["bun","hono","html-to-pdf","puppeteer"],"latest_commit_sha":null,"homepage":"https://html-to-pdf-psi.vercel.app","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/kavindu-mane.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-10T15:28:10.000Z","updated_at":"2025-07-23T09:32:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"aa2a385f-f9c4-464b-b8d3-ac98d2e57021","html_url":"https://github.com/kavindu-mane/HTML-To-PDF","commit_stats":null,"previous_names":["kavindu-mane/html-to-pdf"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kavindu-mane/HTML-To-PDF","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavindu-mane%2FHTML-To-PDF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavindu-mane%2FHTML-To-PDF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavindu-mane%2FHTML-To-PDF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavindu-mane%2FHTML-To-PDF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kavindu-mane","download_url":"https://codeload.github.com/kavindu-mane/HTML-To-PDF/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavindu-mane%2FHTML-To-PDF/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32555839,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T00:31:16.350Z","status":"ssl_error","status_checked_at":"2026-05-03T00:31:15.546Z","response_time":132,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bun","hono","html-to-pdf","puppeteer"],"created_at":"2024-12-19T22:33:45.972Z","updated_at":"2026-05-03T01:40:41.641Z","avatar_url":"https://github.com/kavindu-mane.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HTML-To-PDF\n\n## How to Run\n\n_Migrating Bun to Nodejs_\n\nThis project build on bun runtime environment. if you need this project on nodejs , you need migrate to Nodejs.\n\n- Step - 1 : Install required dependency for hono (Backend)\n\n  ```\n  make bun-to-node\n  ```\n\n- Step - 2 : You need change `index.ts` file in `api/src`. (Follow instructions on that file)\n\n_Setup_\n\n```typescript\n// Bun\nmake setup\n\n// Node js\nmake setup-node\n```\n\n_Start Servers_\n\n```typescript\n// Bun\nmake dev\n\n// Node js\nmake dev-node\n```\n\nUse can serve on `http://localhost:9000`\n\n## Usage\n\n_With fetch_\n\n```typescript\nconst downloadPDF = async () =\u003e {\n\tconst res = await fetch(\"http://localhost:9000/pdf\", {\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\"Response-Type\": \"blob\",\n\t\t},\n\t\tbody: JSON.stringify({ html: html }),\n\t});\n\tconst blob = await res.blob();\n\tconst url = window.URL.createObjectURL(new Blob([blob], { type: \"application/pdf\" }));\n\tconst link = document.createElement(\"a\");\n\tlink.href = url;\n\tlink.setAttribute(\"target\", \"_blank\");\n\tdocument.body.appendChild(link);\n\tlink.click();\n};\n```\n\n_With axios_\n\n```typescript\nconst downloadPDF = async () =\u003e {\n\tawait axios\n\t\t.post(\n\t\t\t\"http://localhost:9000/pdf\",\n\t\t\t{ html: html },\n\t\t\t{\n\t\t\t\tresponseType: \"blob\",\n\t\t\t}\n\t\t)\n\t\t.then((res) =\u003e {\n\t\t\tconst url = window.URL.createObjectURL(new Blob([res.data], { type: \"application/pdf\" }));\n\t\t\tconst link = document.createElement(\"a\");\n\t\t\tlink.href = url;\n\t\t\tlink.setAttribute(\"target\", \"_blank\");\n\t\t\tdocument.body.appendChild(link);\n\t\t\tlink.click();\n\t\t});\n};\n```\n\nIf You face any colour missing issue in generated pdf, You can use below css code in your style sheet.\n\n```css\nhtml {\n\t-webkit-print-color-adjust: exact;\n}\n```\n\n## License\n\nMIT\n\n## Author\n\n[Kavindu Manahara](https://github.com/kavindu-mane)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkavindu-mane%2Fhtml-to-pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkavindu-mane%2Fhtml-to-pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkavindu-mane%2Fhtml-to-pdf/lists"}