Giter Site home page Giter Site logo

lambda-office-to-pdf-processor's Introduction

File Processor

Convert Office (docx, pptx, xlsx) to PDF at scale.

Support for custom fonts to conversion. See the fonts folder for supported fonts. Add your own to support even more.

Functions:

  • HTTP endpoint
  • SQS queue

Dependencies

Config

Uses the serverless-config.dev.json or the serverless-config.prod.json to handle different AWS resources, such as buckets, SQS etc.

Uses SSM Parameter Store (console.aws.amazon.com/systems-manager/parameters) to keep your API-Key safe. Visit the AWS console to setup your parameters.

You have to create FileProcessor/dev/ApiKey

Usage

HTTP Endpoint

Once deployed, you can hit the api like this:

curl --location 
--request POST 'https://someurl.execute-api.eu-west-1.amazonaws.com/dev/api/v1/file/convert' \
--header 'X-API-KEY: my-custom-api-key' \
--header 'Content-Type: application/json' \
--data-raw '{
    "url": "https://my-website.com/path/to/doc.pptx"
}'

HTTP Response:

{
    "output_url": "https://office-file-processor-dev.s3.eu-west-1.amazonaws.com/conversions/1608127441661/doc.pdf"
}

SQS Event

With SQS Queue we can use much higher processing time for complex documents. Secondly we can use SQS to integrate to a service in a private network.

{
    "bucket": "office-file-processor-dev",
    "key": "path/to/doc.pptx"
}

Optionally, you can specify the file ACL, and a http callback if you need to communicate to a service with the conversion results.

{
    "bucket": "office-file-processor-dev",
    "key": "path/to/doc.pptx",
    "acl": "public-read",
    "callback_url": "https://example.com/your/callback/route?id=123456789"
}

DEPLOYMENT

Deploy Dev

serverless deploy --stage dev --verbose

Deploy Production

serverless deploy --stage prod --verbose

lambda-office-to-pdf-processor's People

Contributors

viezel avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

stefanorg

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.