Skip to content

PDFCLOUD-6559 Add passwords to image conversions - #52

Closed
datalogics-tsmith wants to merge 10 commits into
mainfrom
pdfcloud-6559-img-passwords
Closed

datalogics-tsmith wants to merge 10 commits into
mainfrom
pdfcloud-6559-img-passwords

Conversation

@datalogics-tsmith

Copy link
Copy Markdown
Contributor

PDFCLOUD-6559

Why this change

The pdfRest image conversion routes accept an open password for encrypted PDFs, but the Python SDK did not expose that option. Users therefore could not convert password-protected PDFs through the typed BMP, GIF, JPEG, PNG, or TIFF helpers.

Prerequisite: PR #51 must be merged before this PR. This branch is stacked on the joboptions work from that PR.

What changed (high level)

The shared graphic payload now accepts an optional non-empty password, and all five synchronous and asynchronous image helpers pass it through to the service. Keeping the field on the shared payload gives every image format the same validation and serialization behavior.

The change also adds focused unit and live coverage, documents the option, and provides an end-to-end example that protects a PDF and then converts it to PNG.

Behavior changes

Callers can now pass password= to convert_to_bmp, convert_to_gif, convert_to_jpeg, convert_to_png, and convert_to_tiff, including their asynchronous equivalents. Omitting the argument preserves existing behavior; an empty password is rejected locally before transport execution.

This is a backward-compatible public API addition.

Validation

  • uv run pytest -n auto --maxschedchunk 2 -m 'not live' — 2,883 passed and 10 skipped
  • uv run ruff format .
  • uv run ruff check .
  • Basedpyright with an explicit project virtual-environment configuration
  • uv run mkdocs build --strict
  • uv build
  • Manual live service smoke tests converted one password-protected PDF through all five image formats and returned the expected MIME types
  • The new live pytest module was not run end to end because the supplied test credential does not satisfy the SDK's existing UUID-format check; the service accepted it when only that local format check was bypassed

Risks and follow-ups

The primary integration risk is merge ordering: PR #51 must land first because this branch contains its commits. After PR #51 merges, this PR should be refreshed against main so reviewers see only the image-password changes.

The new argument is optional and uses the existing graphic payload and transport paths, so existing unencrypted conversion calls are unaffected.

- Accept uploaded .joboptions profiles in sync and async conversion
- Validate profile type, extension, size, and file count
- Serialize the uploaded profile as the job_options_id request field

Assisted-by: Codex
- Upload a known-valid Distiller profile for integration coverage
- Verify sync and async conversions return both uploaded input IDs

Assisted-by: Codex
- Add a runnable conversion with an uploaded Distiller profile
- Include deterministic PostScript and joboptions example assets
- Document the workflow in the example inventory and API guides

Assisted-by: Codex
- Update project metadata for the joboptions feature release
- Keep the locked editable package version in sync

Assisted-by: Codex
- Exercise metadata and cardinality failures through both clients
- Verify accepted file sizes at and adjacent to each boundary
- Ensure invalid inputs fail before reaching the transport

Assisted-by: Codex
- Set the validation profile to request PDF 1.6 output
- Download sync and async results to confirm the requested version

Assisted-by: Codex
- Upload an invalid Distiller profile as a live-test fixture
- Assert the service rejection through sync and async clients

Assisted-by: Codex
- Accept open passwords for PNG, BMP, GIF, JPEG, and TIFF helpers
- Serialize passwords through the shared sync and async payload contract
- Cover request serialization and empty-password rejection

Assisted-by: Codex
- Verify encrypted inputs across PNG, BMP, GIF, JPEG, and TIFF
- Exercise correct passwords through synchronous and asynchronous clients
- Confirm incorrect passwords return an API error

Assisted-by: Codex
- Add a runnable protected-PDF-to-PNG workflow using an open password
- Link the example from the inventory and API guide for discoverability

Assisted-by: Codex
@netlify

netlify Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for pdfrest-python ready!

Name Link
🔨 Latest commit a776995
🔍 Latest deploy log https://app.netlify.com/projects/pdfrest-python/deploys/6ad0f3b527b2094c9c4b910a
😎 Deploy Preview https://deploy-preview-52--pdfrest-python.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@datalogics-tsmith

Copy link
Copy Markdown
Contributor Author

Branch name is incorrect and does not meet repository standards. Will re-push with correct naming convention

This branch was successfully deployed

1 active deployment
ci-live — a7769950 Deployed Oct 15, 2026 by datalogics-tsmith via Examples (Python 3.14) #564
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