protected $height;
protected $cssWidth;
protected $cssHeight;
- public $cssScale;
+ protected $cssOneWidth;
+ protected $cssOneHeight;
+ protected $cssScale;
protected $optimalWidth = 567;
protected $optimalHeight = 709;
protected $additionalConfig = array();
$this->pdf2htmlRatio = round($imagesize[0] / $this->width, 2);
$this->cssScale = min($this->optimalWidth / $this->width, $this->optimalHeight / $this->height);
+ $this->cssOneScale = min(($this->optimalWidth * 2) / $this->width, $this->optimalHeight / $this->height);
$this->cssWidth = $this->width * $this->cssScale;
$this->cssHeight = $this->height * $this->cssScale;
+ $this->cssOneWidth = $this->width * $this->cssOneScale;
+ $this->cssOneHeight = $this->height * $this->cssOneScale;
+
$this->scale = 10;
- $this->multiply = $this->pdf2htmlRatio * $this->scale * $this->cssScale;
+ if ($this->book->parametres->zoomMode == 1) {
+ $this->multiply = $this->pdf2htmlRatio * $this->scale * $this->cssOneScale;
+ } else {
+ $this->multiply = $this->pdf2htmlRatio * $this->scale * $this->cssScale;
+ }
$this->numerotation = explode(',', $this->book->numerotation);
}
+
+ public function getCssScale(){
+ if($this->book->parametres->zoomMode==1){
+ return $this->cssOneScale;
+ }else{
+ return $this->cssScale;
+ }
+ }
public function virtualToPhysical($virtual) {
if (!in_array($virtual, $this->numerotation)) {
$res = array();
// General theme
- $h = $this->cssHeight . 'px';
- $w2 = ($this->cssWidth * 2) . 'px';
- $w = $this->cssWidth . 'px';
+
+ if ($this->book->parametres->zoomMode == '1') {
+ // Slideshow mode
+ $cssScale = $this->cssOneScale;
+ $cssWidth = $this->cssOneWidth;
+ $cssHeight = $this->cssOneHeight;
+ $w2 = ($cssWidth * 2) . 'px';
+ } else {
+ // Normal mode
+ $cssWidth = $this->cssWidth;
+ $cssHeight = $this->cssHeight;
+ $cssScale = $this->cssScale;
+ $w2 = ($cssWidth * 2) . 'px';
+ }
+
+ $h = $cssHeight . 'px';
+
$wm = ($this->width * $this->multiply) . 'px';
$hm = ($this->height * $this->multiply) . 'px';
- $offsetLeft = round(($this->optimalWidth - $this->cssWidth) / 2, 2);
+ $w = $cssWidth . 'px';
+ $offsetLeft = round(($this->optimalWidth - $cssWidth) / 2, 2);
$offsetLeft2 = $offsetLeft * 2;
- $offsetTop = round(($this->optimalHeight - $this->cssHeight) / 2, 2);
-
- $navTop = ($this->cssHeight - 40 - 100) / 2;
-
-
+ $offsetTop = round(($this->optimalHeight - $cssHeight) / 2, 2);
+ $navTop = ($cssHeight - 40 - 100) / 2;
$res[] = '#fluidbook{left:' . $offsetLeft . 'px;top:' . $offsetTop . 'px;}';
$res[] = '.landscape #fluidbook{left:' . $offsetLeft2 . 'px;}';
$res[] = '.portrait #pages,.portrait .doublePage.page,.page,.portrait #shadow,#shadow.single,.page .links{width:' . $w . ';max-width:' . $w . ';height:' . $h . ';max-height:' . $h . '}';
- $res[] = '.background{' . $this->writeCSSUA('transform-origin', 'top left') . ';}';
- foreach (self::$resolutions as $r) {
- $ratio = round(72 / $r, 2) * $this->cssScale;
- $wr = $this->cssWidth / $ratio;
- $hr = $this->cssHeight / $ratio;
-
- $br = '.background.r' . $r . '{';
- if ($ratio != 1) {
- $br.=$this->writeCSSUA('transform', 'scale(' . $ratio . ')') . ';';
- }
- $br.='width:' . $wr . 'px;height:' . $hr . 'px;}';
- $res[] = $br;
- }
$res[] = '.doublePage,#pages,.landscape #shadow.double{width:' . $w2 . ';max-width:' . $w2 . ';height:' . $h . ';max-height:' . $h . '}';
$res[] = '.landscape #shadow.single.right{left: ' . $w . ';}';
$res[] = '.landscape .page.right{left:' . $w . '}';
$res[] = '#pagesnumbers{display:none;}';
}
+
+ $res[] = '.background{' . $this->writeCSSUA('transform-origin', 'top left') . ';}';
+ foreach (self::$resolutions as $r) {
+ $ratio = round(72 / $r, 2) * $cssScale;
+
+ $wr = $cssWidth / $ratio;
+ $hr = $cssHeight / $ratio;
+
+ $br = '.background.r' . $r . '{';
+ if ($ratio != 1) {
+ $br.=$this->writeCSSUA('transform', 'scale(' . $ratio . ')') . ';';
+ }
+ $br.='width:' . $wr . 'px;height:' . $hr . 'px;}';
+ $res[] = $br;
+ }
$texts = '.texts{' . $this->writeCSSUA('transform-origin', 'top left') . ';';
- $texts.=$this->writeCSSUA('transform', 'scale(' . round((1 / $this->multiply) * $this->cssScale, 2) . ')') . ';';
+ $texts.=$this->writeCSSUA('transform', 'scale(' . round((1 / $this->multiply) * $cssScale, 2) . ')') . ';';
$texts.='width:' . $wm . '; max-width:' . $wm . ';';
$texts.='height:' . $hm . '; max-height:' . $hm . ';';
$texts.='}';
}
protected function getCSSSize($size) {
- $os=$size;
+ $os = $size;
$size = $this->normalizeFloatValue($size);
$size*=$this->multiply;
return $this->getIndex($size, $this->cssSize);
public function getCSSContainer() {
$css = '#link' . $this->id . '{';
- $css.='left:' . $this->left * $this->compiler->cssScale . 'px;top:' . $this->top * $this->compiler->cssScale . 'px;';
- $css.='width:' . $this->width * $this->compiler->cssScale . 'px;height:' . $this->height * $this->compiler->cssScale . 'px;';
+ $css.='left:' . $this->left * $this->compiler->getCssScale() . 'px;top:' . $this->top * $this->compiler->getCssScale() . 'px;';
+ $css.='width:' . $this->width * $this->compiler->getCssScale() . 'px;height:' . $this->height * $this->compiler->getCssScale() . 'px;';
$css.=$this->getCSS();
$css.='}';
return $css;
$e = explode('.', $file);
$ext = array_pop($e);
$basename = implode('.', $e);
- $w = round($this->width*$this->compiler->cssScale);
- $h = round($this->height*$this->compiler->cssScale);
+ $w = round($this->width*$this->compiler->getCssScale());
+ $h = round($this->height*$this->compiler->getCssScale());
$res = '<video width="' . $w . '" height="' . $h . '"';
if ($this->video_auto_start) {
}
public function getEmbed() {
- return '<iframe width="' . $this->width*$this->compiler->cssScale . '" height="' . $this->height*$this->compiler->cssScale . '" src="' . $this->getEmbedURL() . '" frameborder="0" allowfullscreen></iframe>';
+ return '<iframe width="' . $this->width*$this->compiler->getCssScale() . '" height="' . $this->height*$this->compiler->getCssScale() . '" src="' . $this->getEmbedURL() . '" frameborder="0" allowfullscreen></iframe>';
}
public function getEmbedURL() {
class multimediaLink extends wsHTML5Link {
public function getHTMLContent() {
- return cubeMedia::flashObject(wsHTML5Link::getUniversalLocation($this->to), $this->width*$this->compiler->cssScale, $this->height*$this->compiler->cssScale, array(), '', '', 9, '#ffffff', '', 'true', 'noscale', 'transparent');
+ return cubeMedia::flashObject(wsHTML5Link::getUniversalLocation($this->to), $this->width*$this->compiler->getCssScale(), $this->height*$this->compiler->getCssScale(), array(), '', '', 9, '#ffffff', '', 'true', 'noscale', 'transparent');
}
}