Giter VIP home page Giter VIP logo

goru's Introduction

Goru

Naming

Oru is the root of "Origami". Goru is the concatenation of Go+oru

This library aims to help people with pdf transformations like rotation, ordering...

Run in docker

docker run -d -p 8080:8080 zenika/goru

Installation

Link the project in your $GOPATH :

mkdir -p $GOPATH/src/github.com/Zenika
ln -s $(pwd) $GOPATH/src/github.com/Zenika/goru

As a prerequisite for managing dependencies, install govendor :

go get -u github.com/kardianos/govendor

Fetch go dependencies :

cd $GOPATH/src/github.com/Zenika/goru
govendor sync

Build

cd $GOPATH/src/github.com/Zenika/goru
go build

Run

Build then launch server :

./goru server

Upload new files with PUT requests on /document/:file/content (file without .pdf suffix) with content type application/pdf.

Download a file with a GET request on /document/:file/content (file without .pdf suffix).

Modify a file with a POST request on /document/:file/edit (file without .pdf suffix) with actions to perform.

Example :

[
  {
    "action": "LEFT_ROTATE_PAGE",
    "page": 1
  },
  {
    "action": "RIGHT_ROTATE_PAGE",
    "page": 2
  },
  {
    "action": "LEFT_ROTATE_PAGE",
    "page": 3
  },
  {
    "action": "LEFT_ROTATE_PAGE",
    "page": 3
  },
  {
    "action": "DELETE_PAGE",
    "page": 4
  },
  {
    "action": "MOVE_PAGE",
    "page": 53,
    "target": 1
  }
]

WARNING ! The PDF file gets modified in place without backup !

Run in CLI mode

Download a PDF to manipulate :

curl http://www.syntec.fr/fichiers/Annexes/20130719184036_Convention_Syntec_Annexe_06.pdf -o syntec.pdf

Examples

Left rotate a page :

./goru left-rotate-page syntec.pdf 1 test.pdf

Delete a page :

./goru delete-page syntec.pdf 2 test.pdf

Move a page :

./goru move-page syntec.pdf 54 1 test.pdf

goru's People

Contributors

frinyvonnick avatar jlandure avatar nebulis avatar nlepage avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

goru's Issues

Send error messages

Send an error message when using via HTTP and a problem occurs.
JSON format :

{
   "message": "XXX"
}

Versionning

  • Make a release/tag of the project
  • Have the version number in the binary
  • Add a version command
  • Send back the version in the root ressource cf #11
  • Add the commit hash in addition to the version

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.