silverstripe-textextraction/docs/en/developer-docs.md

24 lines
433 B
Markdown
Raw Normal View History

2015-11-06 23:50:19 +01:00
# Developer documentation
## Usage
Manual extraction:
```php
$myFile = '/my/path/myfile.pdf';
$extractor = FileTextExtractor::for_file($myFile);
$content = $extractor->getContent($myFile);
```
Extraction with `FileTextExtractable` extension applied:
```php
$myFileObj = File::get()->First();
$content = $myFileObj->getFileContent();
```
This content can also be embedded directly within a template.
```
$MyFile.FileContent
```