mirror of
https://github.com/silverstripe/silverstripe-textextraction
synced 2024-10-22 11:06:00 +02:00
433 B
433 B
Developer documentation
Usage
Manual extraction:
$myFile = '/my/path/myfile.pdf';
$extractor = FileTextExtractor::for_file($myFile);
$content = $extractor->getContent($myFile);
Extraction with FileTextExtractable
extension applied:
$myFileObj = File::get()->First();
$content = $myFileObj->getFileContent();
This content can also be embedded directly within a template.
$MyFile.FileContent