{"id":13615512,"url":"https://github.com/mnapoli/serverless-pdf-generator","last_synced_at":"2025-04-23T12:42:15.972Z","repository":{"id":66272869,"uuid":"370376040","full_name":"mnapoli/serverless-pdf-generator","owner":"mnapoli","description":"Serverless PDF generator","archived":false,"fork":false,"pushed_at":"2021-06-18T09:41:26.000Z","size":205,"stargazers_count":59,"open_issues_count":0,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T23:41:20.405Z","etag":null,"topics":["serverless"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"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/mnapoli.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}},"created_at":"2021-05-24T14:13:55.000Z","updated_at":"2024-07-29T16:50:09.000Z","dependencies_parsed_at":"2024-01-17T00:54:45.378Z","dependency_job_id":"3c339716-2f9a-4a0a-87aa-c09ecf3761f2","html_url":"https://github.com/mnapoli/serverless-pdf-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnapoli%2Fserverless-pdf-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnapoli%2Fserverless-pdf-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnapoli%2Fserverless-pdf-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnapoli%2Fserverless-pdf-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnapoli","download_url":"https://codeload.github.com/mnapoli/serverless-pdf-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250436793,"owners_count":21430555,"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":["serverless"],"created_at":"2024-08-01T20:01:14.634Z","updated_at":"2025-04-23T12:42:15.953Z","avatar_url":"https://github.com/mnapoli.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"PDF generator built as a serverless application.\n\nRuns on AWS Lambda, built with the Serverless Framework and [Lift](https://github.com/getlift/lift).\n\n## Why?\n\nThis is a small application that turns web pages into PDF.\n\n- Turns HTML pages to PDF using Chrome Headless and Puppeteer\n- Runs on AWS Lambda: extremely cheap, deploys in 1 minute, scales automatically\n- Generated PDFs are cached in AWS S3 to be served faster\n\nThis allows to generate PDF files by simply implementing web pages in your application.\n\nClear and simple API for your application:\n\n```\nhttps://123456.execute-api.us-east-1.amazonaws.com/pdf?url=\u003cURL to export\u003e\n```\n\n## Demo\n\nTry the live demo:\n\nhttps://7f3oaopd3c.execute-api.us-east-1.amazonaws.com/pdf?url=https://bref.sh/docs/\n\n☝️ the link above will export the [bref.sh/docs/](https://bref.sh/docs/) page into a PDF.\n\nFeel free to change the URL to export. However, the demo only allows generating PDF from the `bref.sh` domain.\n\n## Deployment\n\n- Install and set up [the Serverless Framework](https://www.serverless.com/framework/docs/getting-started/)\n- Clone this repository\n- Install dependencies: `npm ci`\n- Run `serverless deploy`\n\nThe URL of the deployed application should display in the terminal.\n\n## Usage\n\nCall the application's URL and append the `?url=` query parameter with the URL of the page you wish to export.\n\nFor example:\n\n```\nhttps://123456.execute-api.us-east-1.amazonaws.com/pdf?url=https://mywebsite.com/\n```\n\nThe exported PDF will be returned.\n\n### Force regeneration\n\nPDF are generated on the first HTTP call and cached into S3. That makes subsequent responses much faster.\n\nTo force regenerating the PDF (for example if the web page has changed), add the `force=1` query parameter to the URL.\n\n## Configuration\n\nChange the `DOMAIN_WHITELIST` environment variable to set the whitelisted domains.\n\nIndeed, to avoid abuse, the application will only generate PDFs from pre-approved domain names.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnapoli%2Fserverless-pdf-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnapoli%2Fserverless-pdf-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnapoli%2Fserverless-pdf-generator/lists"}