Search by

adachsoft / pdf-tool

Arkadiusz Adach

AI SPI tools for PDF creation and text extraction within a sandbox.

Package info

gitlab.com/a.adach/pdf-tool

Issues

pkg:composer/adachsoft/pdf-tool

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

v0.1.0 2026-10-09 08:18 UTC

This package is not auto-updated.

Last update: 2026-10-10 04:36:56 UTC


README

PDF Tool provides AI-oriented tools for creating, extracting, and editing PDF documents inside a controlled sandbox.

Features

  • Convert plain text or HTML content into PDF files.
  • Extract text from PDF files with optional page ranges.
  • Add, remove, and replace PDF pages.
  • Expose each operation through the adachsoft/ai-tool-call tool contract.
  • Keep file operations inside the configured sandbox.

Installation

composer require adachsoft/pdf-tool

The package requires PHP 8.3 or newer and integrates with the PDF contracts and sandbox contracts provided by the AdachSoft ecosystem.

Integration

Create a PdfToolConfig with the application sandbox path, provide an implementation of the required PDF contract, and inject both into the selected tool. Each tool exposes a static getDefinition() method for AI tool registration and a callTool() method for executing a validated tool request.

use AdachSoft\PdfTool\Tool\PdfConvertTool;
use AdachSoft\PdfTool\Tool\PdfToolConfig;

$config = new PdfToolConfig($sandboxPath);
$convertTool = new PdfConvertTool($pdfConverter, $config);

$definition = PdfConvertTool::getDefinition();
$result = $convertTool->callTool($request);

See the PDF conversion example for a complete request payload and the changelog for release history.

Available tools

ClassResponsibility
AdachSoft\\PdfTool\\Tool\\PdfConvertToolConverts text or HTML content, or a source file, to PDF.
AdachSoft\\PdfTool\\Tool\\PdfExtractToolExtracts text from a PDF file.
AdachSoft\\PdfTool\\Tool\\PdfPageEditorToolAdds, removes, or replaces PDF pages.

Sandbox safety

Input and output paths are resolved through the configured sandbox. Paths that escape the sandbox are rejected before the underlying PDF service is called.

License

This library is distributed under the MIT license.