Skip to content

Latest commit

 

History

History
62 lines (45 loc) · 2.74 KB

README.md

File metadata and controls

62 lines (45 loc) · 2.74 KB

pdf-genie

Docker image-based AWS Lambda function in Node.js that converts any document format that LibreOffice can import into any document format that LibreOffice can export, and a thumbnail image.

based on javidlakha/unofuction.

Artwork by brazilianferalcat

Deployment at AWS

  • Create a new repositery
  • Go to view push commands

Screenshot of View push commands on AWS ECR repo page

  • Follow the steps mentioned in the pop-up
  • After deploying the image to ECR, set up a new container image Lambda function by providing the latest uploaded ECR Container Image URL from the previous steps

Screenshot of Create Container Image Lambda Function

Check out this detailed and very easy to follow article for step by step tutorial!

How to run locally

  • Ensure Docker is installed on your system.
  1. Building the image
docker build -t pdf-genie:latest .

2(a). Running the image (x86_64)

docker run -p 9000:8080 pdf-genie:latest

2(b). Running the image (Mac M1-M2)

docker run --platform linux/amd64 -p 9000:8080 pdf-genie:latest
  1. Locally running at
http://localhost:9000/2015-03-31/functions/function/invocations

for more details - AWS Docs.

Sample Event

If routed through AWS API Gateway,

{
    "media_url": "<YOUR-MEDIA-URL>",
    "convert_to": "pdf OR <ANY-OTHER-SUPPORTED-FORMAT>"
}

Supported Libraries

  • Libreoffice
  • Poppler-Utils (incl. pdfinfo, pdftocairo etc.. )