class ProcessFile
{
+ const EMPTY_SVG = '<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"/>';
+
protected $format = 'jpg';
/**
* @var int|string
return $svgFile;
}
PDFTools::makeBaseSVGFile($this->getSplittedPDFPage(), $svgFile, 1);
+ if (file_exists($svgFile) && filesize($svgFile) == 0) {
+ file_put_contents($svgFile, static::EMPTY_SVG);
+ }
return $svgFile;
}
protected function _isSVGValid($file)
{
+ if (!file_exists($file) || filesize($file) === 0) {
+ return false;
+ }
$svg = new DOMDocument();
$svg->preserveWhiteSpace = false;
$svg->load($file, LIBXML_PARSEHUGE);