Giter Site home page Giter Site logo

pdftoimageconverter's Introduction

PDFToImageConverter

Convert pdf file to image

  1. Download trim.js
  2. Open terminal, Enter
cd AWS-trim-master
  1. In the AWS-trim-master folder create node_modules folder
  2. Now enter following code in terminal
npm install async gm fs mktemp bluebird request docx-pdf-pagecount
  1. The AWS Lambda runtime already has the AWS SDK for JavaScript in Node.js, So we don't need to install AWS SDK.
  2. Select trim.js & node_modules folder and create a zip file.
  3. In AWS, create a lambda function and upload this zip in Function code section, Change the HandlerInfo name to trim.handler.
  4. Entert the Environment values of Client_Identifier, Instance_URL & Result_File_Name.
  5. In the designer section, add trigger S3 bucket to your AWS lambda function.
  6. Now when ever you upload a file to bucket, you can see the new folder with converted images.
  7. Following is an example test event, (update s3 bucket name, key, file size & file etag )
{
  "Records": [
    {
      "eventVersion": "2.0",
      "eventSource": "aws:s3",
      "awsRegion": "us-west-2",
      "eventTime": "1970-01-01T00:00:00.000Z",
      "eventName": "ObjectCreated:Put",
      "userIdentity": {
        "principalId": "AIDAJDPLRKLG7UEXAMPLE"
      },
      "requestParameters": {
        "sourceIPAddress": "127.0.0.1"
      },
      "responseElements": {
        "x-amz-request-id": "C3D13FE58DE4C810",
        "x-amz-id-2": "FMyUVURIY8/IgAtTv8xRjskZQpcIZ9KG4V5Wp6S7S/JRWeUWerMUE5JgHvANOjpD"
      },
      "s3": {
        "s3SchemaVersion": "1.0",
        "configurationId": "testConfigRule",
        "bucket": {
          "name": "source-ss",
          "ownerIdentity": {
            "principalId": "A3NL1KOZZKExample"
          },
          "arn": "arn:aws:s3:::source-ss"
        },
        "object": {
          "key": "Planogram.pdf",
          "size": 5820944,
          "eTag": "568ac2228e8f849b8833fac3272ca34e",
          "versionId": "096fKKXTRTtl3on89fVO.nfljtsv6qko"
        }
      }
    }
  ]
}

pdftoimageconverter's People

Contributors

hari8815 avatar hariharasuthan88 avatar ranjith-uk avatar

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.