$this->fields['extraYSpace'] = array('type' => 'integer', 'default' => '0', 'editable' => true, 'label' => __('Marge supplémentaire verticale'), 'grade' => 3);
$this->fields['centerBook'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Centrer la publication sur les couvertures'), 'grade' => 2);
$this->fields['correctCenter'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Corriger les lignes blanches entre les pages'), 'grade' => 2);
- $this->fields['maxResolution'] = array('type' => 'combo', 'default' => 300, 'editable' => true, 'datas' => array('300dpi' => 300, '150dpi' => 150), 'grade' => 2, 'label' => __('Résolution maximale des pages'));
+ $this->fields['maxResolution'] = array('type' => 'combo', 'default' => 300, 'editable' => true, 'datas' => array('300dpi' => 300, '150dpi' => 150, '125dpi' => 125, '100dpi' => 100), 'grade' => 2, 'label' => __('Résolution maximale des pages'));
+ $this->fields['JPEGQuality'] = array('type' => 'integer', 'default' => 85, 'editable' => true, 'grade' => 2, 'label' => __('Qualité JPEG'));
$this->fields['imageFormat'] = array('type' => 'combo', 'default' => 'jpg', 'editable' => true, 'datas' => array(/*__('Le plus léger') => 'best', */
'JPEG' => 'jpg', 'PNG' => 'png'), 'grade' => 2, 'label' => __('Format des images'));
$this->fields['dynamicBackgroundColor'] = ['type' => 'textarea', 'default' => '', 'editable' => true, 'label' => 'Couleur de fond dynamique', 'grade' => 3];
$this->forms['3d_mode'] = array('label' => __('Options de visualisation'),
- 'fieldsnames' => array('mobileNavigationType', '|', 'mobileTransitions', 'mobileTransitionDuration', '|', 'forceWhiteBackground', 'rasterizePages', 'vectorPages', 'visualisationMode', 'antialiasReading', 'correctCenter', 'pagesBaseAngle', 'centerBook', '|', 'extraXSpace', 'mobileExtraXSpace', 'extraYSpace', '|', 'viewMode', '|', 'dynamicBackgroundColor', '|', 'imageFormat', 'maxResolution'));
+ 'fieldsnames' => array('mobileNavigationType', '|', 'mobileTransitions', 'mobileTransitionDuration', '|', 'forceWhiteBackground', 'rasterizePages', 'vectorPages', 'visualisationMode', 'antialiasReading', 'correctCenter', 'pagesBaseAngle', 'centerBook', '|', 'extraXSpace', 'mobileExtraXSpace', 'extraYSpace', '|', 'viewMode', '|', 'dynamicBackgroundColor', '|', 'imageFormat', 'maxResolution', 'JPEGQuality'));
$this->fields['rasterizeOnSafari'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Ecraser les pages pour Safari (Mac OS)'), 'grade' => 1);
$this->forms['performances'] = ['label' => __('Performances'),
$dao = new wsDAODocument($core->con);\r
$this->_docs[$p['document_id']] = $dao->selectById($p['document_id']);\r
}\r
+ if ($format === 'jpg') {\r
+ $q = $this->parametres->JPEGQuality ?? 85;\r
+ } else {\r
+ $q = 85;\r
+ }\r
+ if ($q != 85) {\r
+ $resolution .= '-' . $q;\r
+ }\r
$doc = $this->_docs[$p['document_id']];\r
return $doc->getFile($p['document_page'], $format, $resolution, $withText, $withGraphics, $version, $force);\r
}\r
$this->makeTextSVGFile($page, $file);
}
} else if ($format === 'png' || $format === 'jpg') {
+ $e = explode('-', $resolution);
+ if (count($e) > 1) {
+ $resolution = $e[0];
+ $quality = $e[1];
+ }else{
+ $quality=85;
+ }
+
if ($resolution === 'thumb') {
wsPDFConvert::makeMiniShot($this->getSplittedPDFPage($page), $file, 1, $format);
} else {
$rr = $version === 'html' ? $this->getResolutionRatio() : $this->getMobileFirstRatio();
- wsPDFConvert::makeShotPNM($this->getSplittedPDFPage($page), $file, 1, '', $resolution * $rr, 85, 4, $withText, null, null, $format);
+ wsPDFConvert::makeShotPNM($this->getSplittedPDFPage($page), $file, 1, '', $resolution * $rr, $quality, 4, $withText, null, null, $format);
}
} else if ($format === 'swf') {
wsPDFConvert::makeSWF($this->getSplittedPDFPage($page), $file, 1, $resolution, 80);
'js/libs/threejs/legacy/Projector.js',
'js/libs/threejs/legacy/CanvasRenderer.js',
],
+ 'canvg' =>
+ ['js/libs/canvg/canvg.min.js'],
// 'threejs-latest' =>
// ['js/libs/threejs/latest/three.min.js',
// ],
'js/libs/fluidbook/fluidbook.mobilefirst.js',
'js/libs/fluidbook/mobilefirst/fluidbook.mobilefirst.slider.js',
],
+
];
public $specialJsFiles = array();
public function getResolutions()
{
$res = [];
- foreach (self::$resolutions as $r) {
- if ($r > $this->maxRes) {
- continue;
- }
- $res[] = $r;
+
+ if ($this->maxRes == 300) {
+ $res = [150, 300];
+ } else if ($this->maxRes <= 150) {
+ $res = [$this->maxRes];
}
+
if ($this->widget) {
$res = array_merge(array(36), $res);
}
foreach ($this->getResolutions() as $r) {
foreach ($thisbackgroundPrefix as $backgroundsPrefix) {
$source = $this->book->getFile($page, $this->imageFormat, $r, $backgroundsPrefix, true, $imdir);
- if ($r == 150 && file_exists($source)) {
+ if ($r == $this->maxRes && file_exists($source)) {
$firstDoc = $daoDoc->selectById($infos['document_id']);
$d = $firstDoc->generalInfos['page'][$infos['document_page']]['size'];
$this->config->pagesDimensions[$page] = array($this->cssWidth, $d[1] * ($this->cssWidth / $d[0]));
$this->lessVariables['edge-right-offset'] = 0;
$this->lessVariables['edges-opacity'] = 1;
-
$this->lessVariables['page-number-color'] = wsHTML5::colorToCSS($this->theme->parametres->colorPageNumber);
$this->lessVariables['display-page-number'] = $this->_lessBoolean($this->theme->parametres->displayPageNumber);
$this->lessVariables['page-transition-duration'] = $this->book->parametres->mobileTransitionDuration . 's';