PDFCLOUD-6243: Add PDF shape overlays - #45
Draft
datalogics-kam wants to merge 5 commits into
Draft
Conversation
datalogics-kam
force-pushed
the
pdfcloud-6243-pdf-with-added-shapes
branch
from
August 23, 2026 00:39
847f705 to
ed495f3
Compare
- Define the public color input and internal wire-field routing pattern - Require RGB, CMYK, and invalid-channel coverage Assisted-by: Codex
- Add sync and async shape helpers with typed line and rectangle inputs - Validate shape coordinates, colors, tagging, and PDF resources - Cover JSON serialization, live service behavior, and API guide discovery Assisted-by: Codex
- Resolve MkDocs cross-references for added shape object types - Restore strict documentation build validation Assisted-by: Codex
- Assert async timeout propagation and PDF MIME validation - Reject multiple input PDFs through both client transports - Cover shape geometry, opacity, and color range boundaries Assisted-by: Codex
- Accept one RGB or CMYK color field for each shape color - Route colors to pdfRest's RGB or CMYK wire fields by channel count - Update unit and live endpoint coverage Assisted-by: Codex
datalogics-kam
force-pushed
the
pdfcloud-6243-pdf-with-added-shapes
branch
from
August 23, 2026 13:39
ed495f3 to
c13e6a3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PDFCLOUD-6243
Why this change
The Python SDK did not expose the documented
/pdf-with-added-shapesoperation, forcing callers to build raw requests for line and rectangle overlays. This adds a typed, validated SDK workflow that matches the service contract.What changed (high level)
The clients now provide synchronous and asynchronous
add_shapes_to_pdfhelpers backed by Pydantic request models and public shape type contracts. The implementation keeps uploaded-file lifecycle handling consistent with existing helpers and serializes shape objects into the API JSON layout.Behavior changes
Callers can add one or more lines or rectangles to an uploaded PDF, including RGB or CMYK colors, opacity, stroke width, output naming, and optional accessibility tagging. Local validation rejects invalid coordinates, conflicting color modes, non-PDF inputs, empty shape lists, and tagging metadata without
tag_enabled=True.Validation
uv run pytest --ignore tests/live -n auto --maxschedchunk 2— 1,001 passed.PDFREST_LIVE_BASE_URL=http://sleipnir:3000/ uv run pytest tests/live/test_live_add_shapes_to_pdf.py -n auto --maxschedchunk 2— 4 passed.Risks and follow-ups
This is a stacked draft PR on #44: merge #44 first, then this PR. The PR base is
pdfcloud-6233-new-pdfrest-api-skill, so reviewers see only the endpoint-support layer. No breaking changes are intended.