The zip and unzip calls create or extract ZIP files.
To use this module, you need to install yazl and yauzl on your server:
sudo apt install node-yazl node-yauzl
To use the ZIP calls, the account must have the zip flag set to true:
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...', name: 'Plan.pdf'},
...
];
account.zip(sources, onDone, onError);
function onDone(token, request) {
...
}
function onError(errorCode, request) {
...
}
All PDF files must be uploaded beforehand, if necessary.
POST /backend/zip
Account: ACCOUNT ID
Timestamp: TIMESTAMP
Signature: SIGNATURE
200 with the blob token of the generated ZIP file
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
POST /backend/unzip
Account: ACCOUNT ID
Timestamp: TIMESTAMP
Signature: SIGNATURE
200 with a list of extracted files and their blob tokens
400 if the 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