• Stars
    star
    123
  • Rank 290,145 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

AWS Lambda function that converts HTML pages to PDF documents

Zeplin HTML to PDF Lambda

This is an AWS Lambda function that converts HTML pages to PDF documents using wkhtmltopdf (0.12.4), it implements a simple interface to read and HTML input and output PDF content.

WARNING: You must use v2.x.x tag if you are using Node.js runtime >=10.x in AWS Lambda.

Input

Input event to this function has the following structure:

{
    "html": "<!DOCTYPE html><html><head><title>HTML doc</title></head><body>Content<body></html>"
}

Output

It yields a response in the following format:

{
  "data": "JVBERi0xLjQKMSAwIG9iago8PAovVGl0bGUgKP7..."
}

data is base64 encoding of the converted PDF file.

Test in local environment

The function can be tested locally using AWS SAM CLI. 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.

sam local invoke "HtmlToPdf" -e events/example-event.json

Deploying to AWS

There are two ways in which these functions can be deployed to AWS.

1 - 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.

2 - Check out template.yml file and edit according to your needs then use sam deploy.

More Repositories

1

zeplin-extension-documentation

Documentation for Zeplin extensions ⚗️📚
236
star
2

zeplin-sketch-plugin

Zeplin Sketch plugin 💎⚡️
150
star
3

emoji-autocomplete-sketch-plugin

Type “:” followed by the first few letters to autocomplete emojis. 🍒
Objective-C
149
star
4

connected-components-docs

Documentation for Connected Components
140
star
5

storybook-zeplin

Storybook addon to view Zeplin resources in story panel
TypeScript
115
star
6

zem

Create, test and publish Zeplin extensions with no build configuration ⚗️🦄
JavaScript
81
star
7

fastlane-plugin-notarize

fastlane plugin to notarize a macOS app 🛂
Ruby
68
star
8

react-native-extension

React Native JavaScript snippets from colors, text styles and layers ⚛️📱
JavaScript
67
star
9

zeplin-palette

38
star
10

vscode-extension

Zeplin for Visual Studio Code 🔌
TypeScript
34
star
11

cli

Command-line interface for Zeplin
TypeScript
31
star
12

stylesheet-extensions

Zeplin stylesheet extensions monorepo ⚗️🖌
JavaScript
30
star
13

cli-connect-storybook-plugin

Zeplin CLI plugin to generate Storybook links for Zeplin components
JavaScript
20
star
14

zeplin-workbook

15
star
15

microsoft-teams-app

Bring all the important updates from your Zeplin workspace to the Microsoft Teams conversations.
TypeScript
15
star
16

cli-connect-react-plugin

Zeplin CLI plugin for React components
TypeScript
13
star
17

color-picker

macOS color picker that lets you select colors from the project/styleguide you have open in Zeplin
Swift
9
star
18

cli-connect-swift-plugin

Zeplin CLI plugin for Swift
TypeScript
8
star
19

zeplin-prism-extras

Language extras for Prism ✏️
JavaScript
8
star
20

zeplin-popout-extension

Zeplin Popout tool allows you to compare your code output with Zeplin screens for better design-development workflow.
JavaScript
6
star
21

javascript-sdk

Zeplin API client for JavaScript
TypeScript
6
star
22

cli-connect-angular-plugin

Zeplin CLI plugin for Angular components
TypeScript
3
star
23

community-crew-sdk-scripts

Zeplin Node SDK scripts used by Community Crew
JavaScript
3
star
24

openapi

An OpenAPI description for the Zeplin API
2
star