]> _ Git - fluidbook_tools.git/commitdiff
wip #6201 @0:20
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 21 Aug 2023 13:42:54 +0000 (15:42 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 21 Aug 2023 13:42:54 +0000 (15:42 +0200)
.idea/misc.xml
src/Compiler/CompilerInterface.php
src/Compiler/DummyCompiler.php
src/Links/ArticlePDFLink.php

index ff9d5a0175db081a6a47d5c3aff62bb4885cbb31..b04b47c9a3d3e549888b761f55728b962d018d07 100644 (file)
@@ -1,4 +1,3 @@
-<?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="AhkProjectSettings">
     <option name="defaultAhkSdk" value="AutoHotkey" />
index 0747b22841de63215f579dc5bb9ba2618088e371..7a3f2ba098fff98781d3ba1f9747eda33c8f30ac 100644 (file)
@@ -19,6 +19,8 @@ interface CompilerInterface {
 
     public function setSetting($key, $value);
 
+    public function pushSetting($key, $value);
+
     /**
      * @return VirtualDirectory
      */
index 8f4ba1c1e4935f0c74b0ff4a875ae739ce4874da..935a73fdd2fe5aeb4f8c0b34e68719c94fa00ab9 100644 (file)
@@ -139,4 +139,9 @@ class DummyCompiler implements CompilerInterface {
     public function getQuality(): int {
         // TODO: Implement getQuality() method.
     }
+
+    public function pushSetting($key, $value)
+    {
+        // TODO: Implement pushSetting() method.
+    }
 }
index 7d6894982f8f5aea2fe937cc0008f8fbdf9d4bfd..0f4d331dcffb6cd81ff4fc36dd8d10d144276a39 100644 (file)
@@ -11,20 +11,22 @@ class ArticlePDFLink extends ArticleLink {
     public function init() {
         $this->compiler->addPDFJS(true);
 
+        $wdir=$this->compiler->getWorkingDir();
+
         $e = explode('.', $this->to);
         array_pop($e);
         $name = implode('.', $e);
-        $pdffile = $this->compiler->getWorkingDir() . $this->to;
+        $pdffile =$wdir . $this->to;
         $mtime = filemtime($pdffile);
 
-        $htmlfile = $this->compiler->getWorkingDir() . $name . '.html';
+        $htmlfile =$wdir . $name . '.html';
         if (!file_exists($htmlfile) || filemtime($htmlfile) < $mtime) {
             $cmd = "pdftotext -f 1 -l 1 -htmlmeta $pdffile $htmlfile";
             `$cmd`;
         }
 
-        $cut = $this->wdir . $name . '.c.pdf';
-        $size = $this->wdir . $name . '.s.pdf';
+        $cut =$wdir . $name . '.c.pdf';
+        $size = $wdir . $name . '.s.pdf';
 
         $dim = Image::getimagesize($pdffile);
         $infos = ['width' => $dim[0], 'height' => $dim[1]];