public function makeSVGFile($page)
{
$svgFile = $this->out . '/html/fp' . $page . '.svg';
+ $source = $this->cropped;
+ if (!file_exists($this->cropped)) {
+ $source = $this->in;
+ }
$pdftocairo = new cubeCommandLine('pdftocairo');
$pdftocairo->setPath(CONVERTER_PATH);
$pdftocairo->setArg('r', 300);
$pdftocairo->setArg(null, '-expand');
$pdftocairo->setArg(null, '-svg');
- $pdftocairo->setArg(null, $this->cropped);
+ $pdftocairo->setArg(null, $source);
$pdftocairo->setArg(null, $svgFile);
$pdftocairo->execute();
+
$this->addToLog($pdftocairo, true, $page);
}
public static function extractTexts($svgFile, $textFile, $force = false)
{
- $do = $force || !file_exists($textFile) || filemtime($svgFile) > filemtime($textFile) || filemtime($textFile) < filemtime(__FILE__);
+ $do = $force || !file_exists($textFile) || filesize($textFile) < 100 || filemtime($svgFile) > filemtime($textFile) || filemtime($textFile) < filemtime(__FILE__);
if (!$do) {
return;
}
$iw = $this->_config['width'];
$ih = $this->_config['height'];
- $ld = '';
+ $ld = ' ';
if (isset($this->_config['lowDef'])) {
$ld = ' data-ld="' . str_replace('index.html', $this->_config['lowDef'], $this->_url) . '" ';
}