{"id":13343932,"url":"https://github.com/zeplin/zeplin-html-to-pdf","last_synced_at":"2025-04-04T13:08:50.784Z","repository":{"id":48028501,"uuid":"65331015","full_name":"zeplin/zeplin-html-to-pdf","owner":"zeplin","description":"AWS Lambda function that converts HTML pages to PDF documents","archived":false,"fork":false,"pushed_at":"2025-03-11T11:57:26.000Z","size":22422,"stargazers_count":132,"open_issues_count":12,"forks_count":53,"subscribers_count":27,"default_branch":"develop","last_synced_at":"2025-03-28T12:04:49.389Z","etag":null,"topics":["aws-lambda","html","html-to-pdf","nodejs","pdf","pdf-document","wkhtmltopdf","zeplin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/zeplin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-08-09T21:57:20.000Z","updated_at":"2025-03-11T11:57:30.000Z","dependencies_parsed_at":"2025-01-18T21:41:56.315Z","dependency_job_id":"170936b4-5941-4eef-a455-bd8a5ee41e0e","html_url":"https://github.com/zeplin/zeplin-html-to-pdf","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeplin%2Fzeplin-html-to-pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeplin%2Fzeplin-html-to-pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeplin%2Fzeplin-html-to-pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeplin%2Fzeplin-html-to-pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeplin","download_url":"https://codeload.github.com/zeplin/zeplin-html-to-pdf/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247180039,"owners_count":20897141,"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":["aws-lambda","html","html-to-pdf","nodejs","pdf","pdf-document","wkhtmltopdf","zeplin"],"created_at":"2024-07-29T19:32:05.496Z","updated_at":"2025-04-04T13:08:50.768Z","avatar_url":"https://github.com/zeplin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zeplin HTML to PDF Lambda\n\nThis is an AWS Lambda function that converts HTML pages to PDF documents using wkhtmltopdf (0.12.4). It implements a simple interface to read HTML input and output PDF content.\n\n\u003e **WARNING**: You must use v2.x.x tag if you are using Node.js runtime \u003e=10.x in AWS Lambda.\n\n## Input\nInput event to this function has the following structure: \n```\n{\n    \"html\": \"\u003c!DOCTYPE html\u003e\u003chtml\u003e\u003chead\u003e\u003ctitle\u003eHTML doc\u003c/title\u003e\u003c/head\u003e\u003cbody\u003eContent\u003c/body\u003e\u003c/html\u003e\"\n}\n```\n\n\n## Output\nIt yields a response in the following format: \n```\n{\n  \"data\": \"JVBERi0xLjQKMSAwIG9iago8PAovVGl0bGUgKP7...\"\n}\n```\n`data` is base64 encoding of the converted PDF file. \n\n\n## Test in local environment\nThe function can be tested locally using [AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-command-reference.html). You can change contents of `events/example-event.json` or you can create a new file which you will give sam as an event parameter.\n\n```\nsam local invoke \"HtmlToPdf\" -e events/example-event.json\n````\n\n## Deploying to AWS\nThere are two ways in which these functions can be deployed to AWS.\n\n1 - Check our `npm run deploy:dev` and `npm run deploy:prod` commands in `package.json` and change it according to your needs. Do not forget to add environment variables (you can find it under `template.yml`) to your lambda function in aws lambda edit page or running [lamba update-function-configuration command](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-function-configuration.html). Be sure to create the following environment variable in Lambda: `FONTCONFIG_PATH=/var/task/fonts`\n\n2 - Check out `template.yml` file and edit according to your needs then use `sam deploy`.\n\n## Fonts\nProvide the related font file under the `fonts` directory to support specific languages and characters.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeplin%2Fzeplin-html-to-pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeplin%2Fzeplin-html-to-pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeplin%2Fzeplin-html-to-pdf/lists"}