funstaff / tika
libs for tika wrapper
Installs: 23 949
Dependents: 1
Suggesters: 0
Security: 0
Stars: 11
Watchers: 3
Forks: 6
Open Issues: 0
Requires
- php: >=5.3.2
- psr/log: >=1.0
- symfony/process: >=2.3
Requires (Dev)
- phpunit/phpunit: ^4.0
This package is auto-updated.
Last update: 2024-10-29 04:14:33 UTC
README
A wrapper php for Tika binary
Installation
To install tika with Composer just run:
$ php composer.phar require funstaff/tika dev-master
Usage
<?php use Funstaff\Tika\Configuration; use Funstaff\Tika\Document; use Funstaff\Tika\Wrapper; $config = new Configuration('/path/to/tika.jar'); $config ->setOutputFormat('html') ->setOutputEncoding('UTF-8'); $wrapper = new Wrapper($config); $wrapper ->addDocument(new Document('doc.pdf','/path/to/document.pdf')) ->addDocument(new Document('doc2.pdf','/path/to/document2.pdf')) ->execute(); /* Get All documents */ $documents = $wrapper->getDocument(); /* or only one document */ $document = $wrapper->getDocument('doc.pdf'); /* Get Document content */ $content = $document->getContent(); /* or raw content (output of Tika) */ $content = $document->getRawContent(); /* Get All Metadata for document (only on xml and html output format) */ $metadata = $document->getMetadata(); /* Get Value for metadata */ $author = $metadata->get('author');
Credits
To all users that gave feedback and committed code https://github.com/Funstaff/Tika.
© Bertrand Zuchuat - Funstaff