tiff2pdf (from libtiff) as a service.
- Run
make deps
to download and install libtiff - Run
make test
(optional: convertst2p-test/tifs/*
to PDFs int2p-test/pdfs/
) - Run
make
to buildgo-tiff2pdf
library and service - Run
./build/go-tiff2pdf
ormake run
to start the service
This has been tested on:
- Mac OS X 10.10 with Go 1.3.1 and Go 1.3.3
- Ubuntu 14.04 with Go 1.2.1
To convert a TIFF to PDF, POST
the TIFF bytes as the request body to the /convert
endpoint.
You can set PDF metadata using the headers:
PDF-Subject
PDF-Author
PDF-Creator
PDF-Title
PDF-PageSize
PDF-FullPage
Log messages for a request are linked together using a randomly generated unique ID.
You can set the X-Request-ID
header to override the default random ID.
POST /convert HTTP/1.1
Content-Type: image/tiff
PDF-Subject: pdf subject line
PDF-Author: pdf author
PDF-Creator: pdf creator
PDF-Title: pdf title
PDF-PageSize: A4
PDF-FullPage: true
X-Request-ID: my-unique-id
[TIFF bytes]
HTTP/1.1 200 Ok
Content-Type: application/pdf
Content-Length: [n]
PDF-Pages: [n]
[PDF bytes]