Download the PHP package imal-h/pdf-box without Composer
On this page you can find all versions of the php package imal-h/pdf-box. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download imal-h/pdf-box
More information about imal-h/pdf-box
Files in imal-h/pdf-box
Package pdf-box
Short Description The most advanced, driver-based PDF manipulation library for PHP v3.0. Supports Ghostscript, Chrome Headless (HTML to PDF), OpenSSL/FPDI (Signing), and PDFtk (Forms).
License MIT
Homepage https://github.com/imalhasaranga/PDFLib.git
Rated 4.50 based on 2 reviews
Informations about the package pdf-box
Try out before you actually use it
PDFLib v3.1
The most advanced, driver-based PDF manipulation library for PHP.
PDFLib v3.1 is the mature, stable release of the new driver-based architecture. It allows you to switch between powerful backends like Ghostscript, PDFtk, OpenSSL, and Tesseract for different tasks, all under a single, beautiful fluent API.
👉 Read the Documentation
🛡️ Stability Guarantee (v4.0 Ready)
We take backward compatibility seriously.
The v3.1 architecture introduces a strict separation between the API (Facade) and the Execution Logic (Drivers).
- Zero Breaking Changes Promise: This structure allows us to upgrade the underlying engine (e.g., adding Cloud/Async support in v4.0) without changing a single line of your application code.
- Pipeline Pattern: Operations like
rotate()orocr()are queued, decoupling your intent from immediate execution. Use PDFLib with confidence knowing the API is frozen and stable.
🚀 What's New in v3.1?
- OCR Support: Extract text from images and PDFs using Tesseract.
- Redaction: Securely blackout sensitive text.
- Metadata: Read/Write PDF metadata.
- Laravel Wrapper: First-party ServiceProvider and Facade.
- Stateful Chaining: Queue multiple operations (
->rotate()->watermark()->save()).
📦 Requirements
- PHP >= 8.1
- Ghostscript >= 9.16 (for GhostscriptDriver)
- Google Chrome or Chromium (for HTML to PDF)
- pdftk (PDF Toolkit) (for Form Filling)
Quick Start: Run
./bin/install-dependenciesto automatically install these tools.
👉 See Installation Guide for detailed setup instructions on macOS, Ubuntu, and Windows.
🔧 Installation
✨ Features
| Feature | Description | Driver |
|---|---|---|
| HTML to PDF | Generate PDF from HTML/CSS | Chrome |
| Digital Sign | Sign PDFs with X.509 Certs | OpenSSL |
| OCR | Extract text from PDF/Images | Tesseract |
| Redact | Blackout sensitive text | Ghostscript |
| Fill Forms | Fill AcroForms (FDF) | PDFtk |
| Inspect Forms | Get Field Names | PDFtk |
| Convert | PDF to Images (PNG/JPG) | Ghostscript |
| Merge | Combine multiple PDFs | Ghostscript |
| Split | Extract pages or ranges | Ghostscript |
| Compress | Optimize PDF file size | Ghostscript |
| Encrypt | Password protection and permissions | Ghostscript |
| Watermark | Overlay text on pages | Ghostscript |
| Rotation | Rotate pages 90/180/270° | Ghostscript |
| Metadata | Edit Title, Author, Keywords | Ghostscript |
| Flatten | Burn forms into content | Ghostscript |
📖 Usage
HTML to PDF (New in v3.0)
Generate PDFs from HTML content or URLs using Chrome Headless.
Digital Signatures (New in v3.0)
Digitally sign PDFs using OpenSSL (requires tecnickcom/tcpdf).
Note: If you use a self-signed certificate (like in testing), PDF viewers will show "Signature Validity Unknown". For a green "Trusted" checkmark, use a certificate issued by a recognized Certificate Authority (CA) or explicitly trust your self-signed certificate in the viewer's settings.
Laravel Integration
Publish the config file:
Use the Facade in your controllers:
OCR (New in v3.1)
Extract text from scanned PDFs or images.
Redaction (New in v3.1)
Permanently remove sensitive text.
Interactive Forms
Fill PDF forms programmatically using pdftk.
The Modern Way (Fluent API)
The Legacy Way (v2.x Facade)
Existing code continues to work without changes, but is marked as deprecated.
Example: Advanced Chain
(Note: Current driver operations like encrypt, rotate, and watermark are immediate and require a destination path. Fully stateful chaining for these methods is planned for v3.1)
🔮 Roadmap
Want to see what's coming next (v3.1+)? Check out our Roadmap.
🤝 Contributing
We welcome contributions! Please see CONTRIBUTING for details on our new coding standards (Pint, PHPStan) and architecture.
📄 License
The MIT License (MIT). Please see License File.
Initiative of Treinetic (Pvt) Ltd.
All versions of pdf-box with dependencies
ext-fileinfo Version *
symfony/process Version ^6.4 || ^7.0
tecnickcom/tcpdf Version ^6.10
setasign/fpdi Version ^2.6