Imprenta
An AWS lambda in python 3 that generates PDF files from HTML using jinja, pdfkit and wkhtmltopdf.
Install / Use
/learn @alfredo/ImprentaREADME
Imprenta
An AWS lambda that generates PDF files from HTML using pdfkit and wkhtmltopdf.
This package will:
- Read context variables from the API payload.
- Render context varialbes with the
vendor/templates/base.html. - Pass the rendered HTML to wkhtmltopdf to generate the PDF
- Upload the PDF file to S3.
- Return a signed URL of the PDF and the key.
This package is not feature complete. It is intended to be the starting point for a PDF generator as the HTML template will need to be coded, the context variables handled and authentication added.
Chalice microframework is used to do the aws configuration heavylifting.
Requirements
- Docker
- virtualenv (recommended).
- GNU make
- awscli python package installed and configured.
Bootstrapping
A bootstrap script has been created for convenience. Make sure the project virtualenv is activated before running this command.
$ make build
This command will:
- Download and install wkhtmltopdf
- Build docker and install amazon-linux specific dependencies.
- Install package dependencies in the active python environment.
- Prepare the chalice initial configuration.
After this command has been run the environment variables in pdf/.chalice/conf.json must be added. These AWS credentials must match the
Deploy
A command has been created to deploy the application
$ make deploy
Running it local
The lambda can be run locally, but the wkhtmltopdf binary won't run since it is using the linux binary at the moment.
$ make local
Related Skills
tmux
344.4kRemote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
claude-opus-4-5-migration
99.2kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
model-usage
344.4kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
summarize
344.4kSummarize or extract text/transcripts from URLs, podcasts, and local files (great fallback for “transcribe this YouTube/video”).
