Lpdf Python SDK: render PDF documents from XML or from code.
With data binding, PDF/A, PDF/UA, PDF/X and Factur-X / ZUGFeRD.
pip install lpdfio-lpdffrom lpdf import L, NoAttr, DocumentAttr, LayoutAttr, ColumnAttr, RowAttr, TextAttr, DividerAttr
engine = L.engine()
doc = L.document(DocumentAttr(size='Letter'), [
L.section(NoAttr, [
L.layout(LayoutAttr(margin='48pt'), [
L.column(ColumnAttr(gap='24pt'), [
L.row(RowAttr(justify='between'), [
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.row(RowAttr(gap='12pt', align='start'), [
L.text(TextAttr(color='#888888', width='24pt'), ['01']),
L.text(TextAttr(width='fill'), ['Discovery & Research']),
]),
]),
]),
]),
])
pdf = engine.render(doc)- Python 3.11 or later, on Linux (x86_64 or aarch64, glibc or musl), macOS (x86_64 or arm64) or Windows (x64 or arm64)
- Nothing else: the engine runs inside Python on the
wasmtimepackage, which pip installs with the SDK
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.
Licensed under the Lpdf License. See LICENSE for full terms.