Skip to content

PDFCLOUD-6579 Add color conversion rendering intent - #65

Draft
datalogics-tsmith wants to merge 3 commits into
pdfcloud-6578-add-markdown-inline-outputfrom
pdfcloud-6579-add-color-conversion-rendering-intent
Draft

datalogics-tsmith wants to merge 3 commits into
pdfcloud-6578-add-markdown-inline-outputfrom
pdfcloud-6579-add-color-conversion-rendering-intent

Conversation

@datalogics-tsmith

Copy link
Copy Markdown
Contributor

PDFCLOUD-6579

Why this change

The color-conversion service supports rendering-intent selection, but the Python client did not expose that option. Callers therefore could not choose how out-of-gamut colors are mapped when converting a PDF to a preset or uploaded ICC profile.

What changed (high level)

The synchronous and asynchronous convert_colors helpers now accept a typed PdfRenderingIntent. The public literal documents every value in the Cloud OpenAPI contract, and the payload model owns validation and wire serialization. Omitting the argument leaves it out of the request so pdfRest continues to use the profile-defined intent.

Unit and live suites cover all documented values through both transports, exact request serialization, customization, local invalid-value rejection, and server-side rejection. The API guide and a standalone example make the new workflow discoverable.

Behavior changes

Callers can select profile, perceptual, relative_colorimetric, saturation, or absolute_colorimetric when converting PDF colors. Unsupported values fail locally with a Pydantic validation error before transport execution. Existing calls that omit rendering_intent retain their previous request shape and behavior.

This change is additive and does not introduce a breaking API change.

Validation

  • Focused color-conversion unit suite: 52 passed
  • Full non-live suite: 3,594 passed and 10 skipped
  • Python 3.10 through 3.14 nox matrix: passed with 96% aggregate coverage
  • Client class-function coverage gate: passed the 90% threshold
  • uv run pre-commit run --all-files
  • uv run ruff check .
  • uv run basedpyright
  • uv run mkdocs build --strict

The API-backed live rendering-intent tests and runnable example could not be executed locally because PDFREST_API_KEY was unavailable. The main-repository draft PR is expected to run those checks in CI.

Risks and follow-ups

This draft is stacked directly on #64. The stack must merge in order: #60, #61, #62, #63, and #64 should all merge before this pull request. Once those prerequisites land, GitHub can retarget this pull request to main automatically or the base can be updated manually if needed.

The main compatibility risk is accidentally sending a default intent where older callers omitted the field; unit coverage explicitly verifies omission remains unchanged. No migration is required.

- Expose the documented rendering-intent choices as a public type.
- Send an explicitly selected intent through sync and async clients while
  preserving the existing omitted-parameter behavior.

Assisted-by: Codex
- Verify every documented intent through payload, sync, and async paths.
- Add live success and rejection coverage for the server contract.

Assisted-by: Codex
- Add a standalone sRGB conversion example using perceptual rendering.
- Link the rendering-intent contract from the API guide and inventory.

Assisted-by: Codex

This branch had an error being deployed

1 failed deployment
ci-live — 22af602c Deployed Nov 12, 2026 by datalogics-tsmith via Live Tests (Python 3.11) #624
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant