GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - vote/pdf_filler: PDF Filling Lambda Function

BranchesTags
Open more actions menu

Latest commit

 

History

176 Commits
176 Commits

Folders and files

NameName
Last commit message
Last commit date
app
app
 
 
bin
bin
 
 
utils
utils
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
Pipfile
Pipfile
 
 
Pipfile.lock
Pipfile.lock
 
 
README.md
README.md
 
 
deployment-policy.json
deployment-policy.json
 
 
package.json
package.json
 
 
pyproject.toml
pyproject.toml
 
 
serverless.yml
serverless.yml
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

PDF Filler

The VoteAmerica PDF Filler is a Lambda function that wraps PDFTK to fill in PDF forms and stamp signatures onto PDFs.

Usage

The PDF Filler is a single Lambda function that can be invoked with the following payload

{
  "template": {
    "pdf": "...", // base64-encoded PDF
    "is_form": true,
    "flatten_form": true,
    "signature_locations": {
      "1": { // Page number
        "x": 1,
        "y": 2,
        "width": 3,
        "height": 4
      }
    }
  },
  "data": {
    // key-value pairs
  },
  "signature": "...", // presigned URL of the signature
  "output": "...", // presigned PUT URL for the result PDF
}

You can see an example of calling this in utils/test.py.

PDFTK

This repo includes the prebuilt pdftk binary from the pdftk-java project: https://gitlab.com/pdftk-java

Deployment

This project uses the Serverless framework to deploy an AWS CloudFormation stack. The primary resource in the stack is the Lambda function itself.

To deploy, first make sure you have packages installed by running the following:

pipenv install
yarn install

Your local version of Pipenv and Node could affect your ability to successfully run the deployment process. A combination of Pipenv version 2022.5.2 and Node version 14.21.3 should work.

Make sure your local Docker daemon is running.

Then, run:

sls deploy --stage {stage}

Possible stages include: local, dev, prod

About

PDF Filling Lambda Function

Resources

Readme
MIT license
Activity
Custom properties

Stars

1 star

Watchers

8 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.