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.
Project description
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).
Docs
--
Dual-licensed: Community License (free) and Commercial License (paid). See LICENSE for full terms.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lpdfio_lpdf-0.7.0.tar.gz.
File metadata
- Download URL: lpdfio_lpdf-0.7.0.tar.gz
- Upload date:
- Size: 18.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26c7533434cb2dc4e597d1a5a9dd81dca784500eb0d485aa9ea4c6eb48130aaa
|
|
| MD5 |
f15bd7045dd4e8f0a0a322fe0745e247
|
|
| BLAKE2b-256 |
1bf6b3dc43f275198bf2e2261529d219060280b78f95a57d9da7e4f8e892f849
|
File details
Details for the file lpdfio_lpdf-0.7.0-py3-none-any.whl.
File metadata
- Download URL: lpdfio_lpdf-0.7.0-py3-none-any.whl
- Upload date:
- Size: 43.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
baaa25026b3f8793fe9045de1c7ebffd471b3a824ed1d9dcdd535b3cdad09f09
|
|
| MD5 |
6ea753563fa9daf30a3822b7cc51cff2
|
|
| BLAKE2b-256 |
87de7d8fe71fcf3dd48020874f1d8ea318874094aa4237b66601d84d718e45f0
|