Download the PHP package tudorr89/pdfcombiner without Composer
On this page you can find all versions of the php package tudorr89/pdfcombiner. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package pdfcombiner
PDF Combine
A modern PHP package to combine multiple PDF files with page-level granularity. Built on TCPDF and FPDI for reliable rendering. Supports Laravel auto-discovery (10.x, 11.x, 12.x) and standalone usage.
Requirements
- PHP
^8.2 - Composer
Under the hood the package depends on tecnickcom/tcpdf and setasign/fpdi — both are pulled in automatically.
Installation
Laravel
If you use Laravel ≥ 5.5 the package registers itself via auto-discovery. No manual setup required.
Publish the config (optional):
Standalone (non-Laravel)
Quick Start
Combine two files and save to disk
Combine specific pages only
Stream to browser for download
Get PDF contents as a string
Laravel — Dependency Injection
Laravel — Facade
API Reference
addFile(string $path, array $pages = []): self
Add a PDF file from disk.
$path— absolute or relative path to a.pdffile$pages— optional array of page numbers to include (1-indexed). Empty array = all pages.
addFiles(array $paths): self
Add multiple files at once. Accepts plain paths or [path, pages] tuples.
addRaw(string $content, string $filename = 'document.pdf', array $pages = []): self
Add PDF content from a raw binary string (e.g. from an HTTP response, database BLOB, or upload stream).
save(string $outputPath): bool
Combine all added files and write the result to $outputPath. Returns true on success.
download(string $filename = 'combined.pdf'): void
Send the combined PDF to the browser as a download (sends Content-Disposition: attachment headers + body). Does not call exit — middleware and terminating callbacks still run.
In Laravel, prefer streaming the body yourself so you stay on the full response pipeline:
stream(string $filename = 'combined.pdf'): string
Return the combined PDF as a raw binary string.
blob(): string
Alias for stream().
getPageCount(): int
Return the total number of pages that would be included in the output (honours page-range filters).
getFileCount(): int
Return the number of files currently queued.
reset(): self
Clear all queued files. Preserves orientation / unit / paper size so the same configured instance can be reused.
resetConfig(): self
Restore orientation / unit / paper size to their defaults (P / mm / A4). Does not touch the file queue.
Configuration
Orientation
Unit of measurement
Paper size
Laravel config (config/pdfcombine.php)
Environment variables override the defaults:
Fluent interface
All setter and adder methods return $this, so you can chain calls:
Error handling
The package throws typed exceptions from PdfCombine\Exceptions\PDFCombineException:
| Method | Exception message |
|---|---|
| File not found | PDF file not found at path: ... |
| Invalid / unreadable PDF | The file at '...' is not a valid PDF or could not be read. |
| No files added | No PDF files have been added to combine. |
| Save failed | Failed to save the combined PDF to: ... |
| Page out of range | Requested page X is out of range. The document has Y pages. |
Changelog
See the releases page on GitHub.
License
MIT — see the LICENSE file for details.