Skip to main content

report_pdf_renderer (rust)

Standalone PDF renderer for persisted report templates.

Goals

  • Fast standalone binary (Rust)
  • Render report sections with explicit spacing/layout rules
  • Embed frame images (single image or grid)
  • Render template sentence sections with variable substitution
  • Callable from Python (subprocess) without importing heavy PDF libs

Quick Start (with devenv)

This repo includes a devenv.nix with Rust tooling.

cd lx-report-generator
devenv shell

Then build and run:

cargo build --release
./target/release/report_pdf_renderer \
  --input examples/report_payload.json \
  --output /tmp/report_example.pdf

Open the generated file:

xdg-open /tmp/report_example.pdf

Install From PyPI

Once published, install the renderer with:

python -m pip install report-pdf-renderer

The wheel installs the Rust binary as report_pdf_renderer on your Python environment's PATH:

report_pdf_renderer \
  --input examples/report_payload.json \
  --output /tmp/report_example.pdf

Build (separate install, no devenv)

cargo build --release
# binary: target/release/report_pdf_renderer

CLI

report_pdf_renderer --input payload.json --output report.pdf

Run From Anywhere

Either:

./target/release/report_pdf_renderer --input payload.json --output report.pdf

or install/copy the binary to your PATH:

install -m755 target/release/report_pdf_renderer ~/.local/bin/report_pdf_renderer
report_pdf_renderer --input payload.json --output report.pdf

Backend integration can also point to a custom path via:

export ENDOREG_REPORT_PDF_RENDERER_BIN=/absolute/path/to/report_pdf_renderer

When installed from PyPI in the same runtime environment as the backend, Python callers can either rely on report_pdf_renderer being available on PATH or set the integration variable explicitly:

export ENDOREG_REPORT_PDF_RENDERER_BIN="$(command -v report_pdf_renderer)"

Input JSON (snake_case)

Top-level keys:

  • title: string
  • subtitle: optional string
  • header: optional object
  • layout: optional object (page, margins_mm, spacing values)
  • assets_root: optional path for relative image lookups
  • blocks: ordered content blocks

Supported block types

  • heading
  • paragraph
  • spacer
  • sentence_group (template sentences + variables)
  • image
  • image_grid

sentence_group

{
  "type": "sentence_group",
  "section_title": "Findings",
  "variables": {"segment": "sigma", "size_mm": "8"},
  "sentences": [
    {"template": "Polyp in {segment}.", "enabled": true},
    {"template": "Estimated size {size_mm} mm.", "enabled": true}
  ]
}

image_grid

{
  "type": "image_grid",
  "title": "Frames",
  "columns": 3,
  "image_paths": ["frames/f_001.png", "frames/f_002.png"],
  "captions": ["frame 1", "frame 2"]
}

Notes

  • This renderer uses a lightweight layout engine (text flow + page breaks).
  • For now it uses built-in PDF fonts (Helvetica).
  • If an image fails to load, the renderer logs and continues.
  • Integrate from Python by writing a JSON payload to a temp file and invoking the binary.
  • assets_root is used to resolve relative image paths (e.g. frame images in image_grid).

Metadata

Release files for report-pdf-renderer 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for report-pdf-renderer 0.1.0
File Size Uploaded Provenance
report_pdf_renderer-0.1.0.tar.gz 17.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for report-pdf-renderer 0.1.0
File Interpreter ABI Platform
report_pdf_renderer-0.1.0-py3-none-manylinux_2_34_x86_64.whl Python 3 none Linux glibc 2.34+ x86-64 Details

Total release size: 1.7 MB

Release files / report_pdf_renderer-0.1.0.tar.gz

Download URL report_pdf_renderer-0.1.0.tar.gz
Size 17.0 kB
Tags Source
SHA-256 checksum
How to use checksums
742dbff54ae310a23fcc2a6f437f110ee406df0a9aca33f2d5595f7087e12eae
BLAKE2b-256 checksum
How to use checksums
28d31277fa6ece2964fb7b72dc206fe065cd5f7885e74a2fa31d80daa9c653a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.0

Release files / report_pdf_renderer-0.1.0-py3-none-manylinux_2_34_x86_64.whl

Download URL report_pdf_renderer-0.1.0-py3-none-manylinux_2_34_x86_64.whl
Size 1.7 MB
Tags Linux glibc 2.34+ x86-64 Python 3
SHA-256 checksum
How to use checksums
eb8983e58b9ad0678ab1adfab11093612d93dec78ee876a746dd135df406ffa9
BLAKE2b-256 checksum
How to use checksums
fa4af6efbc1a58a5ccc70d7baa6335b4a9e56ed6bb4e97224d4862d8d83fd655
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.0

Security for report-pdf-renderer 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page