Skip to main content

CompilePDF — the only writer in the Print With Synergy stack. Rewrite, marks, impose, and trap producers built on top of codex-pdf.

Project description

compile-pdf

CompilePDF — the only writer in the Print With Synergy stack.

Four producers under one Python package, four FastAPI services in one Railway project, one Redis-backed Celery broker, one S3-compatible object bucket.

Producer Purpose
compile_pdf.rewrite OCG flips, metadata patches, color-space swaps, hygiene strips, page lifecycle ops on a single PDF
compile_pdf.marks Register / crop / color-bar / fold marks; 1-up proofing slugs; external mark template ingestion
compile_pdf.impose Sheet-level step-and-repeat layout; work-and-turn / tumble; bleed handling
compile_pdf.trap Ink-pair spread / choke trap with three engine slots (pure_python / ghostscript / external)

Architectural invariants (mechanically enforced by scripts/consume_surface_audit.py):

  • CompilePDF is the only writer in the stack.
  • codex-pdf stays read-only — its produce_surface_audit.py enforces.
  • Every producer consumes Codex primitives through published surfaces; re-implementation is forbidden.
  • Every producer emits deterministic bytes; same input + same plan + same engine fingerprint → same SHA-256 output.

Status

compile-pdf 0.5.1 on PyPI, built against codex-pdf 1.8.1. All four producers (rewrite, marks, impose, trap) are live, the CJD orchestrator + lineage store are wired, and retention-for-training is opt-in per request. See CHANGELOG.md for the release log and docs/ for operator + integrator documentation.

Install

pip install compile-pdf

For producers that need geometry primitives (marks, impose, trap):

pip install 'compile-pdf[geom]'

For the trap producer with Ghostscript engine fallback:

pip install 'compile-pdf[geom,trap-gs]'

CLI

compile-pdf rewrite  --plan plan.json     input.pdf output.pdf
compile-pdf marks    --template tmpl.json input.pdf output.pdf
compile-pdf impose   --layout layout.json input.pdf output.pdf
compile-pdf trap     --policy policy.json input.pdf output.pdf

compile-pdf version
compile-pdf contract
compile-pdf health
compile-pdf cjd apply <job.json|job.xml>
compile-pdf lineage <id> [--chain]

Opting in to retention-for-training

Every producer endpoint (and the CJD orchestrator) accepts an explicit opt-in signal that retains the call's inputs and outputs for engine training. Off by default; engaged per-request.

curl -X POST $COMPILE_BASE/v1/rewrite/apply \
  -H "X-Compile-Retain-For-Training: true" \
  -H "X-Compile-Tenant: acme-co" \
  -H "Content-Type: application/json" \
  --data-binary @request.json

Operators wire it up by setting COMPILE_RETAIN_BUCKET and friends (see docs/operations/retention.md). With no bucket configured the consent header is parsed and logged but nothing is written.

CLI defaults to local-mode (in-process) when COMPILE_API_BASE is unset; otherwise POSTs to the configured central or sidecar URL.

Docs

License

AGPL-3.0-or-later. See LICENSE.

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

compile_pdf-0.5.3.tar.gz (386.7 kB view details)

Uploaded Source

Built Distribution

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

compile_pdf-0.5.3-py3-none-any.whl (121.3 kB view details)

Uploaded Python 3

File details

Details for the file compile_pdf-0.5.3.tar.gz.

File metadata

  • Download URL: compile_pdf-0.5.3.tar.gz
  • Upload date:
  • Size: 386.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for compile_pdf-0.5.3.tar.gz
Algorithm Hash digest
SHA256 a67000a48217a156dd840784b9b2e8a1bcede1a2629fdc0af884a2ff17a3fbf0
MD5 77928fe56dbe36b5c68a4abfcb7fdcf7
BLAKE2b-256 d032f96ecbc6f01dafdb9d9e32a0f99d007e2bb7d14f9347b119e0bb2b58c148

See more details on using hashes here.

File details

Details for the file compile_pdf-0.5.3-py3-none-any.whl.

File metadata

  • Download URL: compile_pdf-0.5.3-py3-none-any.whl
  • Upload date:
  • Size: 121.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for compile_pdf-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9d57bd47b9c64a2e9fd5d7082ad1f3c799ea23f0e70ebb50b8ee261c67ff764f
MD5 6df057031f21f1ab5f10497c0df70205
BLAKE2b-256 8875ae50b332fe53b0e5a7d010ee9666adfb245fffaa9a46e6c2232202ffc491

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