Render html to pdf with weasyprint, controled from stdin
Project description
WeasyPrint Daemon
Protocol
start header
On startup, wpd sends a header to stdout, always on a single line:
{"wpd": "<implementation name>", "version": "<version>", "protocol": "1"}\n
job submission
job submission, to stdin:
{"id": "xxx", "css": "css content", "size": <html content size>}\n
html content\n
The json header must be on one line.
cancel job
{"id": "xxx", "action": "cancel"}\n
The job may be canceled by the renderer, but may also be rendered and returned.
get results
result retrieval, from stdout:
{"id": "xxx", "size": <file size>}\n
PDF content\n
The json header will always be on one line.
Any error will be reported as following:
{"id": "xxx", "error": ""}
stopping
To stop the daemon, just close stdin
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
WPD-0.1.1.tar.gz
(2.8 kB
view details)
Built Distribution
WPD-0.1.1-py3-none-any.whl
(3.4 kB
view details)
File details
Details for the file WPD-0.1.1.tar.gz
.
File metadata
- Download URL: WPD-0.1.1.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88be42e116d8becc9c3e68037c64566ddf967d8ea0bffa4b4c5630ad85795a41 |
|
MD5 | 85f8f745eda0f4de2314b108f549bde4 |
|
BLAKE2b-256 | 6e77da008a6da7321d72e56e278714f70777fd965b4752b8633b3bbd892d5f13 |
File details
Details for the file WPD-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: WPD-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5d23d7a16ef2f3378d02e61c866451c3c293c7d2eabc500a3390279ec99828f |
|
MD5 | e0519adba97f2933aaea7ab2e0a05cf0 |
|
BLAKE2b-256 | 5cac58ff5b091ee72468fa6e3273bb605d954864513270764b5da7749668aafd |