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

readPageCount() protected method

protected readPageCount ( $path = null )
    protected function readPageCount($path = null)
    {
        $pageCount = null;
        if (!$path) {
            $path = $this->getFileSystemPath();
        }
        if (!\Pimcore\Document::isAvailable()) {
            Logger::error("Couldn't create image-thumbnail of document " . $this->getRealFullPath() . " no document adapter is available");
            return null;
        }
        try {
            $converter = \Pimcore\Document::getInstance();
            $converter->load($path);
            // read from blob here, because in $this->update() (see above) $this->getFileSystemPath() contains the old data
            $pageCount = $converter->getPageCount();
            return $pageCount;
        } catch (\Exception $e) {
            Logger::error($e);
        }
        return $pageCount;
    }