A small microservice that rasterizes a PDF as an image file (use case: thumbnailing).
You can run this:
- on AWS Lambda
- with Docker
- I didn't bother making a
Dockerfile
though, since I didn't need it. PR welcome!
- I didn't bother making a
- as a standalone binary
There also exists a small client library for Go
You can start a local server process with:
$ pdfrasterizer server
Then call it from the client:
$ export PDFRASTERIZER_TOKEN="doesntMatter" # optionally you can put the service behind authentication
$ pdfrasterizer client-localhost example.pdf > example.png
You can also use raw curl:
$ curl -H 'Content-Type: application/pdf' -X POST --data-binary @example.pdf http://localhost/rasterize > example.png
Internally, it uses Ghostscript.