Skip to content

PDFCLOUD-5475 Add PDF compression#7

Merged
datalogics-cgreen merged 4 commits intopdfrest:mainfrom
datalogics-kam:pdfcloud-5475-pdf-compression
Jan 5, 2026
Merged

PDFCLOUD-5475 Add PDF compression#7
datalogics-cgreen merged 4 commits intopdfrest:mainfrom
datalogics-kam:pdfcloud-5475-pdf-compression

Conversation

@datalogics-kam
Copy link
Copy Markdown
Contributor

PDFCLOUD-5475

Summary

  • add a compress_pdf helper to both PdfRestClient and AsyncPdfRestClient, backed by the new PdfCompressPayload, to properly serialize files, compression levels, optional profiles, and custom outputs while relaxing the response models so compression responses that only
    return IDs stay valid
  • build exhaustive regression coverage for compression: new sync/async unit tests now verify success paths, request customization, validator errors, payload requirements, and async parity; live tests mirror those scenarios and introduce a reusable JSON compression profile under tests/resources/
  • document the testing ethos by expanding AGENTS.md and adding TESTING_GUIDELINES.md, which lays out expectations (sync+async coverage, numeric range boundaries, live-negative cases, reuse of shared helpers) for current and future pdfRest endpoints

- Introduced `compress_pdf` method for both synchronous and asynchronous
  `PdfRestClient` instances.
- Added `PdfCompressPayload` to model validation with constraints for files,
  compression levels, profiles, and output settings.
- Included live and unit tests to validate presets, custom profiles, request
  customization, and error handling.
- Added new live test resources and sample compression profile.

Assisted-by: Codex
- Compression might return just a warning.
- Require separate test cases for `PdfRestClient` and `AsyncPdfRestClient`
  in both unit and live test suites to verify synchronous and asynchronous
  behavior independently.

Assisted-by: Codex
- Introduced `TESTING_GUIDELINES.md` to formalize expectations for unit
  and live tests across sync and async clients.
- Detailed core principles, environment configuration, and validation
  patterns for robust API testing.
- Covered transports, error handling, literal enumeration, and boundary
  value analysis.
- Provided guidelines on mocking, file handling, request customization,
  and serialization to ensure complete coverage and consistency.
- Added instructions for expanding tests as pdfRest evolves to support
  new APIs.

Assisted-by: Codex
@datalogics-cgreen datalogics-cgreen merged commit d2fc602 into pdfrest:main Jan 5, 2026
9 checks passed
@datalogics-kam datalogics-kam deleted the pdfcloud-5475-pdf-compression branch January 5, 2026 18:12
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.

2 participants