Bumps [socket.io](https://github.com/socketio/socket.io) from 4.5.2 to 4.5.3. - [Release notes](https://github.com/socketio/socket.io/releases) - [Changelog](https://github.com/socketio/socket.io/blob/main/CHANGELOG.md) - [Commits](https://github.com/socketio/socket.io/compare/4.5.2...4.5.3) --- updated-dependencies: - dependency-name: socket.io dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> |
||
|---|---|---|
| .. | ||
| docker | ||
| .eslintrc.yml | ||
| .gitignore | ||
| annotate_pdfparser.py | ||
| annotate_pypdf.py | ||
| config.js.in | ||
| docker-compose.yml.in | ||
| package-lock.json | ||
| package.json | ||
| pdfannotate | ||
| pdfdraw.service | ||
| README.md | ||
| server.js | ||
pdfdraw server
This document describes the pdfdraw server API.
Requirements
pdftk should be available as a package pdftk or pdftk-java.
The svg2pdf tool can be installed with
pip install svglib
Most Linux distributions provide pyPdf in a package like python-pypdf.
Preparation
Make sure all requirements are installed and can be executed from the user running the pdfdraw server.
Install the node dependencies by running npm install in the server folder.
Copy config.js.in to config.js and adjust to your requirements.
Running
The server can be started with node server.js, a systemd service script is
provided in pdfdraw.service.
Annotation events
TODO: Describe the socket.io API.
Downloading PDFs
A client can download annotated PDF documents by sending a HTTP POST to the
download endpoint.
Request parameters (sent as application/json):
token(string): The token used to access the file being annotated.svg(string): The SVG data containing the annotations.text(list): Optional list of text annotations to embedd in the PDF.
The text annotations are a list of objects that must contain the following fields:
page(number): Zero-based page number where the annotation should be added. Will default to the first page if nothing is given.x(number): X position of the annotation.y(number): Y position of the annotation.text(string): The annotation text.color(string): Optional HTML color of the annotation. PDF readers will use a default color if none is provided.author(string): Optional author name to add to the annotation metadata.modified(number): Optional timestamp (seconds since the epoch, in UTC) when the annotation was last modified.
Run pdfdraw server in a docker container using docker-compose.
All settings are exposed into enviroment variables. That means you are able to config the backend server in docker-compose.yml yaml file by editing the corresponding enviroment variables.
Save docker-compose.yml.in to docker-compose.yml and make changes if needed.
Based on your docker setup you still need to edit a few lines in the docker-compose.yml file for networking.
For example by exposing ports:
ports:
- "8080:8080"
or join an existing network:
networks:
default:
external:
name: my-pre-existing-network
For more details read Networking in Compose
Than run docker compose.
docker-compose up -d