PDF Concatenation

The pdf call and concatenates a list of PDF file using pdfunite.

This call may be used to concatenate PDF files created using SVG to PDF.

Account configuration

To use the PDF call, the account must have the pdf flag set to true:

{"key": "...", "pdf": true, "...": null}

HTTP/REST Requests

POST /backend/pdf
Account: ACCOUNT ID
Timestamp: TIMESTAMP
Signature: SIGNATURE
{"sources": [{"#b": randomHex(32)}, {"#b": randomHex(32)}, "..."]}

Concatenates a list of PDF files to a single PDF file.

Response

  • 200 with the object token of the generated PDF
  • 204, if no source files are specified, and no PDF file is created
  • 400, if a source file is missing
  • 401, if the account ID or signature is missing or invalid
  • 403, if the account is not allowed to use PDF concatenation
Account ID
Account key
Request

JavaScript

Using Backend.js, PDF files can be concatenated as follows:

const backend = new Backend('https://viereck.ch/backend');
const account = backend.account('your-account-id', '44705748... your-account-key');

const sources = [
	{'#b': '7b8cf18d...'},
	...
	];
account.pdf(sources, onDone, onError);

function onDone(token, request) {
	...
}

function onError(errorCode, request) {
	...
}
		

All PDF files must be uploaded beforehand, if necessary.