]> _ Git - cubeextranet.git/commitdiff
wip #5014 @0.25
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 11 Jan 2022 14:35:12 +0000 (14:35 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 11 Jan 2022 14:35:12 +0000 (14:35 +0000)
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index f52949350384e796d774dde930490ae7c9b2ea37..30fdca8d197954518eda2ffb0b94f2b26dd70169 100644 (file)
@@ -28,7 +28,9 @@ class wsHTML5Compiler
         'jquery-extras' => ['js/libs/jquery/jquery.transform.js',
             'js/libs/jquery/jquery.form.min.js',
             'js/libs/jquery/jquery.mousewheel.min.js',
-            'js/libs/jquery/jquery.hashchange.min.js'],
+            'js/libs/jquery/jquery.hashchange.min.js',
+            'js/libs/jquery/jquery.scrollto.min.js',
+            ],
         'aria' => ['js/libs/aria/radio.js',],
         'bluebird' => ['js/libs/bluebird.min.js'],
         'screenfull' => ['js/libs/screenfull.min.js'],
index ed136ea2e9644b1aad6a0da49c2111e0e3d41dba..3f6b5c87528cc45057c73a254e78fde09550f6d0 100644 (file)
@@ -3115,8 +3115,8 @@ class articlePDFLink extends articleLink
 
         $cut = $this->wdir . $name . '.c.pdf';
         $size = $this->wdir . $name . '.s.pdf';
-        $sinfos = $this->wdir . $name . '.s.nfo';
-        if (!file_exists($cut) || !file_exists($size) || !file_exists($sinfos) || filesize($sinfos) === 0 || filemtime($size) < $mtime) {
+        //$sinfos = $this->wdir . $name . '.s.nfo';
+        if (!file_exists($cut) || !file_exists($size) /*|| !file_exists($sinfos) || filesize($sinfos) === 0*/ || filemtime($size) < $mtime) {
             // Cut the pdf in many pages
             $ratio = $infos->width / $infos->height;
             $nb = max(1, ceil(0.707071 / $ratio));
@@ -3130,18 +3130,19 @@ class articlePDFLink extends articleLink
             // Resize to 210mm width
             `pdfposter $cut $size`;
 
-            $i = `pdfinfo -f 1 -l 1 -box $size`;
-            if (preg_match('/Page\s+1\s+size:\s+([0-9\.]+) x ([0-9\.]+)/', $i, $matches)) {
-                $infos = ['width' => $matches[1], 'height' => $matches[1] / $ratio];
-                file_put_contents($sinfos, json_encode($infos));
-            }
+//            $i = `pdfinfo -f 1 -l 1 -box $size`;
+//            if (preg_match('/Page\s+1\s+size:\s+([0-9\.]+) x ([0-9\.]+)/', $i, $matches)) {
+//                $infos = ['width' => $matches[1], 'height' => $matches[1] / $ratio];
+//                file_put_contents($sinfos, json_encode($infos));
+//            }
         } else {
-            $infos = json_decode(file_get_contents($sinfos));
+            // $infos = json_decode(file_get_contents($sinfos));
         }
 
         $this->copyExternalFile($name . '.s.pdf');
+        $this->copyExternalFile($name . '.c.pdf');
         $text = file_get_contents($htmlfile);
-        $this->article = ['page' => $this->page, 'type' => 'pdf', 'id' => $name, 'url' => $name, 'infos' => $infos, 'content' => $name . '.s.pdf', 'textcontent' => $text];
+        $this->article = ['page' => $this->page, 'type' => 'pdf', 'id' => $name, 'url' => $name, 'infos' => $infos, 'printcontent' => $name . '.s.pdf', 'content' => $name . '.c.pdf', 'textcontent' => $text];
         $this->compiler->config->articlesList[] = $this->article;
         $this->compiler->addSEOArticle('#/article/' . $name, $this->title, $this->description, '', $name, $name . '.html', $text);
     }