Metadata-Version: 2.4
Name: compile-pdf-barcode
Version: 0.1.0
Summary: CompilePDF barcode producer — deterministic 1D/2D barcode + GS1 symbol rendering into PDFs.
Project-URL: Homepage, https://compilepdf.com
Project-URL: Repository, https://github.com/printwithsynergy/compile-pdf-barcode
Project-URL: Issues, https://github.com/printwithsynergy/compile-pdf-barcode/issues
Author-email: Print With Synergy <iam@quincy.codes>
License: AGPL-3.0-or-later
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.12
Requires-Dist: compile-pdf-core<1.0,>=0.1.0
Requires-Dist: fastapi>=0.110
Requires-Dist: pikepdf>=8.13
Requires-Dist: pydantic>=2.6
Requires-Dist: segno<2.0,>=1.6
Requires-Dist: structlog>=24.1
Provides-Extra: dev
Requires-Dist: httpx>=0.27; extra == 'dev'
Requires-Dist: mypy>=1.9; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest-cov>=4.1; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Description-Content-Type: text/markdown

# compile-pdf-barcode

Deterministic barcode + GS1 symbol rendering for CompilePDF.

Draws 1D and 2D barcode symbols onto a PDF per a validated plan. CompilePDF is
the only PDF writer in the Print With Synergy stack — this producer *applies*
the barcode plan it is handed; it does not grade the symbol (codex's job) or
decide pass/fail (lint's job).

## Symbologies (1.0.0)

| Symbology | Standard | Kind | Notes |
|-----------|----------|------|-------|
| `code128` | ISO/IEC 15417 | 1D | Auto subset B/C, computed checksum |
| `ean13`   | ISO/IEC 15420 | 1D | 12 digits + computed check, or 13 validated |
| `upca`    | ISO/IEC 15420 | 1D | GTIN-12 subset of EAN-13 |
| `qr`      | ISO/IEC 18004 | 2D | Via `segno`; L/M/Q/H error correction |

## Determinism

Symbols are drawn as black-filled rectangle content streams (one rect per bar /
per dark module), with fixed-decimal numeric formatting and stable rectangle
ordering, then saved with `Pdf.save(deterministic_id=True, linearize=False)`.
Same input PDF + same plan → byte-identical output PDF (verified by the
determinism layer in the verifier). The pure-Python `segno` QR generator is
deterministic for a fixed payload + error level.

## Service-skip (fail-fast)

The 2D (QR) lane requires `segno`. If it is not importable the producer fails
fast with `BARCODE_LIB_MISSING` (HTTP 503) rather than emitting a PDF that lies
about what was drawn — compile is a writer, not a silent skipper.

## Install

```bash
uv pip install compile-pdf-barcode
```

## Position in the stack

One of the [CompilePDF](https://compilepdf.com) producers (rewrite, marks,
impose, trap, soft-proof, separations, white-underbase, barcode, …). Each
lives in its own PyPI package; producers depend on `compile-pdf-core`, never on
each other.

- Repo: https://github.com/printwithsynergy/compile-pdf-barcode
- Deployment host: https://github.com/printwithsynergy/compile-pdf
- License: AGPL-3.0-or-later

## Scoped follow-ups

- **GS1 application identifiers** (SSCC/SGTIN AI bracket encoding, GS1-128 FNC1)
  — the schema accepts raw payloads today; AI-aware encoding is an additive 1.x.
- **DataMatrix** (incl. GS1 DataMatrix) — `segno` is QR-only; DataMatrix needs a
  separate deterministic encoder (additive 1.x, fails fast if its lib is absent).
