Download the PHP package rhysleesltd/laravel-camelot without Composer
On this page you can find all versions of the php package rhysleesltd/laravel-camelot. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rhysleesltd/laravel-camelot
More information about rhysleesltd/laravel-camelot
Files in rhysleesltd/laravel-camelot
Package laravel-camelot
Short Description PHP Wrapper library for interfacing with the Camelot PDF table extraction library built in Python
License MIT
Informations about the package laravel-camelot
rhysleesltd/laravel-camelot
A Laravel wrapper for Camelot—the Python PDF table extraction library. Extract tabular data from PDFs in your Laravel app using the same API as the Camelot CLI, with Laravel helpers (e.g. Arr::, Collection::) and auto-discovered service provider.
Installation
You need both the PHP package and the Python Camelot library (this package calls the Camelot CLI under the hood).
1. PHP package (Laravel)
The CamelotServiceProvider is auto-discovered; no manual registration is required.
2. Python Camelot
Install Camelot so the camelot command is available on your system path. Full details: Camelot installation docs.
Linux (Ubuntu / Debian)
Or with conda: conda install -c conda-forge camelot-py.
macOS
If the Ghostscript library is not found, you may need to symlink it (see the Camelot dependency docs).
Windows
For optional Ghostscript, use the Ghostscript Windows installer. For Tkinter (e.g. for plot), you may need ActiveTcl. See Camelot dependencies for details.
Verify the CLI works: camelot --help
Usage
The package adheres closely with the camelot CLI API Usage.
Default output is in CSV format as a simple string. If you need to parse CSV strings we recommend the league/csv package (https://csv.thephpleague.com/)
Advanced Processing
Saving / Extracting
Note: No Camelot operations are run until one of these methods is run
Set Format
Specify Page Numbers
$camelot->pages('1,2,3-4,8-end')
Reading encrypted PDFs
$camelot->password('my-pass')
Processing background lines
$camelot->stream()->processBackgroundLines()
Visual debugging
$camelot->plot()
Specify table areas
Specify table regions
Specify column separators
$camelot->stream()->setColumnSeparators($x1,$x2...)
Split text along separators
$camelot->split()
Flag superscripts and subscripts
$camelot->flagSize()
Strip characters from text
$camelot->strip("\n")
Improve guessed table areas
$camelot->setEdgeTolerance(500)
Improve guessed table rows
$camelot->setRowTolerance(15)
Detect short lines
$camelot->lineScale(20)
Shift text in spanning cells
$camelot->shiftText('r', 'b')
Copy text in spanning cells
$camelot->copyTextSpanningCells('r', 'b')
Credits
This package is a Laravel-oriented fork of the original PHP wrappers for Camelot. Thanks to:
- randomstate/camelot-php — original PHP wrapper for Camelot (by Random State).
- kayukoff/camelot-php — fork updated for Symfony 6+ and PHP 8+.
The underlying table extraction is done by Camelot (Python). You need Camelot installed and available on your system path.
License
MIT. Use at your own risk, we accept no liability for how this code is used.
All versions of laravel-camelot with dependencies
illuminate/support Version ^9.0|^10.0|^11.0|^12.0|^13.0
symfony/process Version ^5.0|^6.0|^7.0|^8.0
spatie/temporary-directory Version ^2.0