lpdfio-lpdf
Python SDK for Lpdf — PDF as Code on every platform
You describe a document as code or XML. Lpdf renders a compact, pixel-perfect PDF — identical across platforms.
Installation
pip install lpdfio-lpdf
Usage
from lpdf import L, NoAttr
engine = L.engine()
doc = L.document(DocumentAttr(size='letter', margin='48pt'), [
L.section(NoAttr, [
L.layout(NoAttr, [
L.stack(StackAttr(gap='24pt'), [
L.split(NoAttr, [
L.text(TextAttr(font_size='8pt', color='#888888'), ['ACME CORP']),
L.text(TextAttr(font_size='22pt', bold='true'), ['Project Proposal']),
]),
L.divider(DividerAttr(thickness='xs')),
L.text(TextAttr(font_size='13pt', bold='true'), ['Scope of Work']),
L.flank(FlankAttr(gap='12pt', align='start'), [
L.text(TextAttr(color='#888888', width='24pt'), ['01']),
L.text(NoAttr, ['Discovery & Research']),
]),
]),
]),
]),
])
pdf = engine.render(doc)
Requirements
- Python 3.8+
wasmtimeCLI must be available inPATH(used to run the bundled WASI binary).
Versioning
The first two numbers are the Lpdf engine, and the last number counts changes to this package only. 0.22.3 runs engine 0.22, with three Python-only changes since that engine shipped. Every engine release publishes all SDKs at X.Y.0, so the same X.Y means the same engine in every language.
To stay on one engine and still get this package's fixes: pip install "lpdfio-lpdf~=0.22.0".
Docs
--
Dual-licensed: Community License (free) and Commercial License (paid). See LICENSE for full terms.
Metadata
Release files for lpdfio-lpdf 0.18.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lpdfio_lpdf-0.18.0.tar.gz | 26.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lpdfio_lpdf-0.18.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 77.1 kB
Release files / lpdfio_lpdf-0.18.0.tar.gz
| Download URL | lpdfio_lpdf-0.18.0.tar.gz |
|---|---|
| Size | 26.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
480d992d29e1abbcfa2a66ccd5e3c57cc98ee8355b001132d4cbe6b6b8a14e94
|
|
BLAKE2b-256 checksum How to use checksums |
eac5c3f6c6126779188abea2585523b55474c03053225fe5f7b861bc9469b5be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / lpdfio_lpdf-0.18.0-py3-none-any.whl
| Download URL | lpdfio_lpdf-0.18.0-py3-none-any.whl |
|---|---|
| Size | 50.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8e63dfa686492aeee1866ce577fa7391de68318d71921e224764823648e8714e
|
|
BLAKE2b-256 checksum How to use checksums |
45bd8c9aaa86fbcf18c9e79f7f12d439696b1001d31f140281b6325ee74757ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|