adachsoft / pdf-contracts
Contracts, DTOs, Enums and Value Objects for PDF conversion and text extraction.
v0.1.1
2026-10-09 05:41 UTC
Requires
- php: >=8.3
- adachsoft/collection: ^3.0
Requires (Dev)
- adachsoft/php-code-style: ^0.7.1
- friendsofphp/php-cs-fixer: ^3.95
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^12.0 || ^11.0
- rector/rector: ^2.3
- symplify/phpstan-rules: ^14.17
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-10-09 03:44:06 UTC
README
PDF Contracts provides contracts, DTOs, enums, collections, exceptions, and value objects for PDF conversion, page editing, and text extraction workflows.
Features
- Converter and extractor interfaces for integrating PDF implementations.
- Page editor contracts for adding, removing, and replacing pages.
- Immutable DTOs for conversion, extraction, and page-editing options and results.
- Enums for PDF formats, page sizes, orientations, page sources, and insertion positions.
- Value objects for margins, page numbers, and page ranges.
Installation
Install the package with Composer:
composer require adachsoft/pdf-contracts
The package provides PSR-4 autoloading for the AdachSoft\\PdfContracts namespace.
Usage
Create immutable value objects and pass them to an implementation of the provided contracts:
use AdachSoft\\PdfContracts\\Vo\\PdfMarginsVo;
$margins = PdfMarginsVo::createUniform(12.5);
More focused examples are available in docs/examples/.
Requirements
- PHP 8.3 or newer.
License
This library is released under the MIT License. See LICENSE for details.