NodeJS pdftk Web Service
The service is accessible at https://web-pdftk.herokuapp.com/ Called with no parameter, this help is displayed.
The inputs
parameter is used to specify input files by their URL. To work with
multiple input files, URLs must be encoded
& comma-separated.
Chosen operation can be specified using the operation
parameter.
A facultative options
parameter may be provided to pass options to the chosen
operation.
Chaining operations is not supported. Proceed with successive calls to achieve. Giving the service a web-pdftk URL, creating nested queries, is a great way to achieve chaining.
This service doesn't give control over outputs. Output is always served, never stored.
In order to concatenate 2 PDFs from http://www.web.com/file1.pdf & http://www.web.com/file2.pdf, the following URL must be called: https://web-pdftk.herokuapp.com/?inputs=http://www.web.com/file1.pdf,http://www.web.com/file2.pdf&operation=cat
Let's say we want to merge these two PDF files from Wikimedia Commons:
https://upload.wikimedia.org/wikipedia/commons/a/a3/JUA0680291.pdf & https://upload.wikimedia.org/wikipedia/commons/7/79/Bell76.pdf
Yet, to make it more interesting, we also want the first page of each PDF removed. Just resolve the following URL to do the job:
This is the kind of nested queries mentionned earlier: the main request will merge the PDFs (cat called without options), being given as inputs the products of two "subrequests", which will strip the first page off each file.
This service relies on pdftk (obviously!), the pdftk buildpack for Heroku, and the node-pdftk NPM package