{"id":28198807,"url":"https://github.com/mathieutu/pdf-gen","last_synced_at":"2025-05-16T18:14:04.361Z","repository":{"id":287709995,"uuid":"965557564","full_name":"mathieutu/pdf-gen","owner":"mathieutu","description":"Generate a pdf from html content.","archived":false,"fork":false,"pushed_at":"2025-04-13T12:50:48.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T13:36:35.673Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pdf-gen-murex.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mathieutu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-04-13T12:33:34.000Z","updated_at":"2025-04-13T12:50:51.000Z","dependencies_parsed_at":"2025-04-13T13:47:04.214Z","dependency_job_id":null,"html_url":"https://github.com/mathieutu/pdf-gen","commit_stats":null,"previous_names":["mathieutu/pdf-gen"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathieutu%2Fpdf-gen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathieutu%2Fpdf-gen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathieutu%2Fpdf-gen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathieutu%2Fpdf-gen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathieutu","download_url":"https://codeload.github.com/mathieutu/pdf-gen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254582885,"owners_count":22095519,"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":[],"created_at":"2025-05-16T18:14:03.880Z","updated_at":"2025-05-16T18:14:04.332Z","avatar_url":"https://github.com/mathieutu.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PDF Generator\n\nA simple API to generate PDFs from URLs or HTML content, powered by Puppeteer and headless Chromium. This project is open-source and serverless deployment ready.\n\n## Features\n\n- ✅ Generate PDFs from URLs or HTML content\n- ✅ Merge multiple PDFs into one (including the one you generated from HTML)\n- ✅ Powered by Puppeteer and headless Chromium\n- ✅ Serverless deployment ready\n- ✅ Open source\n- 🟠 Customizable page settings (coming soon, open to contributions)\n\n## Get Started\n\n\nYou can try it out on https://pdf.mathieutu.dev.\nThis URL is provided for demonstration purposes only.\n\nPlease deploy it on your own infrastructure, or I'll have to shut it down.\nYou can do it freely on Vercel [with one click](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fmathieutu%2Fpdf-gen).\n\n\nTo generate a PDF, you can make a JSON POST request to the `/api/gen` endpoint with either a `url` or `html` parameter in the request body.\nYou can also merge multiple PDFs by passing an array of PDF URLs in the `merge` parameter. The merged PDF will be returned as a single document.\n\n\n```bash\ncurl -X POST 'https://your-deployment-url/api/gen' \\\n  --header 'Content-Type: application/json' \\\n  --output 'foo.pdf' \\\n  --data-raw '{\n    \"filename\": \"foo.pdf\",\n    \"html\": \"\u003chtml\u003e\u003chead\u003e\u003cscript src=\\\"https:\\/\\/cdn.tailwindcss.com\\\"\u003e\u003c\\/script\u003e\u003c\\/head\u003e\u003cbody class=\\\"h-screen grid place-items-center\\\"\u003e\u003cspan class=\\\"print:hidden\\\"\u003eIT SHOULD NO BE PRINTED\u003c\\/span\u003e\u003cdiv class=\\\"bg-pink-300 text-pink-800 p-8 h-[100px] grid place-items-center font-medium font-mono\\\"\u003e@mathieutu\u003c\\/div\u003e\u003c\\/body\u003e\u003c\\/html\u003e\"\n    \"merge\": [\n      \"https://pour-un-reveil-ecologique.org/documents/54/10_key_points_IPCC_1_2_and_3.pdf\",\n    ]\n  }'\n```\n\nAlternatively, you can directly pass a URL as a query parameter in a GET request:\n\n```bash\nhttps://your-deployment-url/api/gen?url=https://example.com\u0026merge=https://example.com/another.pdf\u0026merge=https://example.com/yet-another.pdf\n```\n\nThe response will be a PDF document with the appropriate content type headers.\n\n## The Author\n\nThis project was created by [@mathieutu](https://mathieutu.dev), a passionate developer focused on building open-source tools and APIs.\n\nFeel free to contribute to the project or [reach out](mailto:contact@mathieutu.dev) for collaboration opportunities.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathieutu%2Fpdf-gen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathieutu%2Fpdf-gen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathieutu%2Fpdf-gen/lists"}