Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lambda HTML to PDF Converter

A serverless AWS Lambda function that converts HTML content to PDF documents. This service provides a simple and efficient way to generate PDFs from HTML input.

Features

  • HTML to PDF conversion using AWS Lambda
  • Serverless architecture
  • Scalable and cost-effective solution

Prerequisites

  • AWS Account
  • AWS CLI installed
  • Python (for local development)

AWS CLI Setup with SSO

  1. Configure AWS SSO:
aws configure sso
  1. Enter the following information when prompted:

    • SSO start URL: [Your SSO Start URL]
    • SSO Region: [Your SSO Region]
    • SSO registration scopes: sso:account:access
  2. Select your AWS account and role when prompted

  3. Verify the login:

aws sts get-caller-identity

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/lambda-html-to-pdf.git
cd lambda-html-to-pdf
  1. Copy and edit the .env.example into .env
ACCOUNT_ID=
REGION=ca-central-1 #aws region to deploy
PROFILE=AWS_PROFILE_NAME_OR_NICKNAME_ENTERED_WHEN_CONFIGURING_AWS_CLI
FUNCTION_NAME=htmlToPdf #name of the lambda function
ROLE_NAME=html-to-pdf-lambda-role #name of the role
REPO_NAME=html-to-pdf-lambda #name of the ecr repo
IMAGE_TAG=latest #usually no need to change

Deployment

  1. Deploy to AWS:
./deploy.sh

Usage

The Lambda function can be invoked with the following payload structure:

{
  "html": "<html><body>Your HTML content</body></html>",
}

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For support, please open an issue in the GitHub repository or contact the maintainers.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages