GithubHelp home page GithubHelp logo

shairozan / rowland Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 156 KB

Rowland is an HTTP based PDF Stamper. Send JSON, get PDF

License: GNU General Public License v3.0

JavaScript 74.30% CSS 0.26% HTML 25.44%

rowland's Introduction

Rowland

Rowland is an implementation of Sails specifically aimed at being a PDF Stamping micro service. To clarify, if you have a PDF with defined form fields, Rowland can populate them and raster them back into a filled PDF. It's great for Invoice generation, Sales Orders, etc.

Rowland accepts two things in a multi-part form post:

  1. A JSON structure indiciating the key-value pairs (name : value) of the fields in the PDF
  2. The PDF that should be populated

This way the application never needs to be hardcoded with files. You just pass it both the document to be filled in, the values to fill it in with, and it responds with the populated PDF. Relies on the pdf-fill-form PDF package which contains the GPL poppler library and the LGPL QT development libraries.

The application gets its name from Rowland Hill, the individual credited with creating the postage stamp.

Setup

  • First thing is to require the system libraries required for the PDF stamping NPM components. You need to setup the environment per pdf-fill-form's information On ubuntu 14.04 and 16.04, you can perform the below
$ sudo apt-get install libpoppler-qt4-dev libcairo2-dev
$ npm install pdf-fill-form
  • Install Sails Globally
$ sudo npm -g install sails
  • Navigate to the Rowland application directory (Where you'll find packages.json) and install the packages
$ npm install
  • In the Rowland directory, start sails!
sails lift

This will start the application on HTTP port 1337. Posts are done to the root of the server itself. No other routes needed. Please refer to sails.js' documentation on how to configure SSL / the framework's general functionality if you're looking at configuring it differently. If you're just interested in running the application itself, Docker images are being created

#Usage

There are now two endpoints in the application. Root and /Remote.

##Root When posting to the root of the application, Rowland expects a multipart encoded form post similar to how you would normally do a a file upload. It should have two components:

  • The file template with a name of "form"
  • The JSON key value pairs with the name of "data"

##Remote I realized that some languages really suck at doing back-end multi-part form encoding, or properly naming components of the request body. For this reason we have the remote endpoint. This accepts two things:

  • filelocation : This is the URL for node to download the file
  • data : The key value pairs to stamp onto the document.

rowland's People

Contributors

shairozan avatar

Stargazers

 avatar Tiago de Almeida Machado avatar  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.