namespace App\Fluidbook;
+use Cubist\Util\CommandLine\Poppler;
use Cubist\Util\Files\Files;
use Fluidbook\Tools\Jobs\ProcessFile;
use hollodotme\FastCGI\Client;
public static function extractPDFArea($file, $page, $rect, $to = null, $options = array(), $cache = null)
{
+ $final = Files::mkdir($cache) . Poppler::extractAreaFilehash($file, $page, $rect, $options) . '.' . $options['format'];
+ if (file_exists($final)) {
+ return $final;
+ }
+
$lock = 'pdfarea_' . hash('sha256', $file . '_' . $page . '_' . json_encode($rect) . '_' . json_encode($options));
return static::lock($file, $lock, function () use ($file, $page, $rect, $to, $options, $cache) {
return self::_getFile(