$this->width = round($this->getFluidbook()->getPageWidth(), 8);
$this->height = round($this->getFluidbook()->getPageHeight(), 8);
- $this->imageFormat =$this->getFluidbook()->getImageFormat();
- $this->fluidbookSettings->set('imageFormat',$this->imageFormat);
+ $this->imageFormat = $this->getFluidbook()->getImageFormat();
+ $this->transparent = $this->getSetting('transparentPage');
+ $this->fluidbookSettings->set('imageFormat', $this->imageFormat);
$p1 = $this->getFluidbook()->getFile(1, $this->imageFormat, 150);
$imagesize = Image::getimagesize($p1);
$resolutions = $this->getResolutions();
- $cacheKey = 'imagesToCopy_' . $this->imageFormat . '_' . md5(json_encode($resolutions));
+ $cacheKey = 'imagesToCopy_' . $this->imageFormat . '_' . ($this->transparent ? 'transparent' : 'opaque') . '_' . md5(json_encode($resolutions));
$cacheKey .= '-' . $this->config->JPEGQuality;
$cacheKey .= '//' . md5(json_encode($this->config->rasterizePages));
$cacheKey .= '||' . md5(json_encode($this->config->vectorPages));
foreach ($resolutions as $r) {
foreach ($thisbackgroundPrefix as $backgroundsPrefix) {
- $source = $this->getFluidbook()->getFile($page, $this->imageFormat, $r, $backgroundsPrefix, true, $imdir);
+ $source = $this->getFluidbook()->getFile($page, $this->imageFormat, $r, $backgroundsPrefix, true, $this->transparent, $imdir);
$filesToCopy[$source] = 'data/background/' . $r . '/' . ($backgroundsPrefix ? 't' : 'p') . $page . '.' . $this->imageFormat;
}
}
}
- public function getFile($page, $format = 'jpg', $resolution = 150, $withText = true, $withGraphics = true, $version = 'html', $force = false)
+ public function getFile($page, $format = 'jpg', $resolution = 150, $withText = true, $withGraphics = true, $transparent = false, $version = 'html', $force = false)
{
$compo = $this->getComposition()[$page];
- $res = self::_getDocument($compo[0])->getFile($compo[1], $format, $resolution, $this->JPEGQuality, $withText, $withGraphics, $version, $force);
- return $res;
+ return self::_getDocument($compo[0])->getFile($compo[1], $format, $resolution, $this->JPEGQuality, $withText, $withGraphics, $transparent, $version, $force);
}