protected static function _getFile($params, $attempts = 3, $checkOutput = true, $preferLocal = false)
{
$start = microtime(true);
+
+ if ($params['operation'] === 'extractpdfarea') {
+ static::$_forceServer = 'amadeus';
+ } else {
+ static::$_forceServer = false;
+ }
+
$farmer = self::pickOneServer($preferLocal, $params);
$params['toolbox'] = '1';
public static function extractPDFArea($file, $page, $rect, $to = null, $options = array(), $cache = null)
{
- return static::lock($file, 'pdfarea_' . $file . '_' . $page . '_' . md5(json_encode($rect)) . '_' . md5(json_encode($options)), function () use ($file, $page, $rect, $to, $options, $cache) {
+ $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(
['operation' => 'extractpdfarea',
'pdf' => $file,
'out' => $cache,
- 'page' => $page,
+ 'page' => json_encode($rect),
'area' => $rect,
- 'options' => $options], 0, false, true);
+ 'options' => json_encode($options)], 0, false, true);
});
}
}