aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 3d3eca503e1a4b0eab35152ddace9493685ecc3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#Hail Hydra

## pdf mangling in a web service

Chromium seems to have a pretty good cross-platform pdf renderer. It's based on the proprietary Foxit PDF library, which is well regarded. Google opensourced their fork of it eventually. It's called pdfium. This code embeds pdfium in a webserver and uses it to transform and rasterise pdfs

### Requirements and dependencies

* pdfium , get it [from here](https://pdfium.googlesource.com/pdfium/). It's quite a pain to build, and a massive pain to link. 
* [Poco C++ framework](https://pocoproject.org). I used the version in the Ubuntu 16.04 repos
* libjpeg-turbo8 
* gcc/g++
* GNU make

### build it

There's a Makefile. You need to point PDFIUM_ROOT at wherever you've built pdfium. The makefile expects you to build products into a directory called 'out' in the pdfium root. If you used something else as a build directory, you'll need to edit that

### run it

The binary is called hydra. It listens on http://localhost:2225 forever. It serves a quarter sized version of a file called test.pdf in the directory it is running in as a jpeg.