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, DocumentAttr, StackAttr, TextAttr, DividerAttr, FlankAttr
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.10+
wasmtimeCLI must be available inPATH(used to run the bundled WASI binary).
Docs
Issues
Report bugs and request features at github.com/lpdfio/lpdf/issues, the one tracker for the engine, the SDKs and the VS Code extension. Pull requests are not accepted.
--
Dual-licensed: Community License (free) and Commercial License (paid). See LICENSE for full terms.
Metadata
Release files for lpdfio-lpdf 0.25.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.25.0.tar.gz | 29.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lpdfio_lpdf-0.25.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 89.1 kB
Release files / lpdfio_lpdf-0.25.0.tar.gz
| Download URL | lpdfio_lpdf-0.25.0.tar.gz |
|---|---|
| Size | 29.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f35dd8b7e3b567b1af7c03223b2c4e93aae9606b9fb68cd7ec84949c93bfafea
|
|
BLAKE2b-256 checksum How to use checksums |
f9975cf1cb5b858795c42db5364c01d74b66299a370354b89a31981e3ebc7903
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / lpdfio_lpdf-0.25.0-py3-none-any.whl
| Download URL | lpdfio_lpdf-0.25.0-py3-none-any.whl |
|---|---|
| Size | 60.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b415d3e5f42d712f9c743feca1ccdd84ee699972637307eceed3b1abaa64adb2
|
|
BLAKE2b-256 checksum How to use checksums |
400e740af8cd0f628db24e917c840781b6454cc26964eb34c15677e3077b7eb4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|