Skip to main content

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

Lpdf

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+
  • wasmtime CLI must be available in PATH (used to run the bundled WASI binary).

Docs

lpdf.io/docs/python

--

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

lpdfio_lpdf-0.7.0.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lpdfio_lpdf-0.7.0-py3-none-any.whl (43.7 kB view details)

Uploaded Python 3

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

Hashes for lpdfio_lpdf-0.7.0.tar.gz
Algorithm Hash digest
SHA256 26c7533434cb2dc4e597d1a5a9dd81dca784500eb0d485aa9ea4c6eb48130aaa
MD5 f15bd7045dd4e8f0a0a322fe0745e247
BLAKE2b-256 1bf6b3dc43f275198bf2e2261529d219060280b78f95a57d9da7e4f8e892f849

See more details on using hashes here.

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

Hashes for lpdfio_lpdf-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 baaa25026b3f8793fe9045de1c7ebffd471b3a824ed1d9dcdd535b3cdad09f09
MD5 6ea753563fa9daf30a3822b7cc51cff2
BLAKE2b-256 87de7d8fe71fcf3dd48020874f1d8ea318874094aa4237b66601d84d718e45f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page