Pimcore\Model\Asset\Document::getText PHP Method

getText() public method

public getText ( $page = null )
    public function getText($page = null)
    {
        if (\Pimcore\Document::isAvailable() && \Pimcore\Document::isFileTypeSupported($this->getFilename())) {
            $cacheKey = "asset_document_text_" . $this->getId() . "_" . ($page ? $page : "all");
            if (!($text = Cache::load($cacheKey))) {
                $document = \Pimcore\Document::getInstance();
                $text = $document->getText($page, $this->getFileSystemPath());
                Cache::save($text, $cacheKey, $this->getCacheTags(), null, 99, true);
                // force cache write
            }
            return $text;
        } else {
            Logger::error("Couldn't get text out of document " . $this->getRealFullPath() . " no document adapter is available");
        }
        return null;
    }