Giter Club home page Giter Club logo

pdfact-service's Introduction

pdfact-service

License actions Docker

A Webservice to analyze the content of PDF Documents using a HTTP API. This is a simple HTTP wrapper around ad-freiburg/pdfact and builds the container image directly from their source.

Usage

Start the service:

> docker run -p 80:80 dnlbauer/pdfact-service

[2022-11-27 12:36:38 +0000] [1] [INFO] Starting gunicorn 20.1.0
[2022-11-27 12:36:38 +0000] [1] [INFO] Listening at: http://0.0.0.0:80 (1)
[2022-11-27 12:36:38 +0000] [1] [INFO] Using worker: gthread
[2022-11-27 12:36:38 +0000] [7] [INFO] Booting worker with pid: 7

PDFs can be POSTed to /analyze as multipart file request. The response will contain the output of pdfact. The response format can be specified using the correct MIME Accept header; pdfact van provide json, xml and plain text as output format.

> curl -H "Accept: application/json" -F [email protected] localhost:80/analyze

{"paragraphs": [
  {"paragraph": {
    "role": "page-header",
    "positions": [{
      "minY": 642.6,
      "minX": 210.3,
      "maxY": 652.6,
      "maxX": 401.6,
      "page": 1
    }],
    "text": "This is a test PDF document."
  }},
  {"paragraph": {
    "role": "body",
    "positions": [{
      "minY": 628.5,
      "minX": 91.2,
      "maxY": 636.6,
      "maxX": 520.8,
      "page": 1
    }],
    "text": "If you can read this, you are lucky."
  }}
]}

Supported cli arguments (--units, --roles) can be supplied as http parameters. Example:

> curl ... localhost:80/analyze?roles=body&units=words

Thanks

All credits go to the Algorithms and Data Structures Group from University of Freiburg for ad-freiburg/pdfact.

License

Published under CC0. Do whatever you want :-)

(but also check the license of pdfact if you are going to use the image as is).

pdfact-service's People

Contributors

dependabot[bot] avatar dnlbauer avatar

Stargazers

 avatar

Watchers

 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.