ericmaciel / node-pdf-tiling

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

node-pdf-tiling

This code receives a PDF file, breaks each page into a .png file. Than each page is resized into 4 levels of zoom (TBD) than each resized picture is cropped into 256x256 tiles.

Usage

GET /files

Retrieve all file ids currently available

GET /files/:id

Retrieve pdf file

GET /files/:id/:page?zoom=[zoom]&row=[row]&col=[col]

Retrieve tile from file id and page [page] in zoom [zoom] row and col. Each tile has 256x256 resolution

GET /files/:id/:page/info

Retrieve page resolution (width and height) {"width": 750,"height": 580}

GET /files/:id/pages

Retrieve count of pages of pdf {"numPages": 1}

Setup

1. Install install GraphicsMagick or ImageMagick

2. Make sure you have Ghostscript

3. Install RabbitMQ or point to a RabbitMQ changing the queue/config.js file

4. npm install

5. Run index.jx and queue/receiver.js

References

node-canvas node-canvas was used on previous versions bellow 0.1, node-canvas](https://github.com/Automattic/node-canvas), choose your OS instalation

Ubuntu

node-pdfreader

pdfdraw

Render PDFs on the Server with PDF.JS and Node-Canvas

gm

Mobile

Android

About


Languages

Language:JavaScript 97.3%Language:HTML 2.7%