]> _ Git - cubist_pdf.git/commitdiff
wip #6188 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 8 Sep 2023 16:29:40 +0000 (18:29 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 8 Sep 2023 16:29:40 +0000 (18:29 +0200)
resources/tools/fwstk/.idea/workspace.xml
resources/tools/fwstk/bin/com/fluidbook/fwstk/TextsThread.class
resources/tools/fwstk/out/artifacts/fwstk_jar/fwstk.jar
resources/tools/fwstk/src/com/fluidbook/fwstk/TextsThread.java
src/PDFTools.php

index 72aa115c080e969f7a08d162cad307037ff5ffa4..a44232e26124d510cb840f5a6397dccc867a87e5 100644 (file)
@@ -9,7 +9,9 @@
     <option name="autoReloadType" value="SELECTIVE" />
   </component>
   <component name="ChangeListManager">
-    <list default="true" id="f146bc67-2578-4de3-9db2-94d2d43e9e83" name="Default" comment="wip #5410" />
+    <list default="true" id="f146bc67-2578-4de3-9db2-94d2d43e9e83" name="Default" comment="wip #5410">
+      <change beforePath="$PROJECT_DIR$/../../../src/PDFTools.php" beforeDir="false" afterPath="$PROJECT_DIR$/../../../src/PDFTools.php" afterDir="false" />
+    </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
     <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
       <workItem from="1694090487471" duration="6051000" />
       <workItem from="1694157597994" duration="9552000" />
       <workItem from="1694187452028" duration="14000" />
+      <workItem from="1694189811041" duration="112000" />
     </task>
     <task id="LOCAL-00001" summary="wip #1111 @0.5">
       <created>1487172253077</created>
index 62eb436de3501751982fbeca155c507b3c311a5a..3826c474c0e025c50b53719ac3feed34d1fa6be1 100644 (file)
Binary files a/resources/tools/fwstk/bin/com/fluidbook/fwstk/TextsThread.class and b/resources/tools/fwstk/bin/com/fluidbook/fwstk/TextsThread.class differ
index e493b0cfea58a2324306bcb199db6b58214efa16..5a27de68a29c9df95f34ffbe3c0906fdfcefd872 100644 (file)
Binary files a/resources/tools/fwstk/out/artifacts/fwstk_jar/fwstk.jar and b/resources/tools/fwstk/out/artifacts/fwstk_jar/fwstk.jar differ
index 0c375536c44a867bc952a71946ddc4c3e40c5bf7..5720ee048f61d1d06bb79bbe4251a57b103700f6 100644 (file)
@@ -206,17 +206,20 @@ public class TextsThread extends Thread {
                                 new FileOutputStream(fpfile), "UTF8"));
                         out.write(fbtext);
                         out.close();
+                        System.out.println("Save texts to "+fpfile);
                         if (!robust) {
                             String fbindex = text2index(fbtext);
                             out = new BufferedWriter(new OutputStreamWriter(
                                     new FileOutputStream(fifile), "UTF8"));
                             out.write(fbindex);
                             out.close();
+                            System.out.println("Save indexes to "+fifile);
                         }
                         out = new BufferedWriter(new OutputStreamWriter(
                                 new FileOutputStream(fhfile), "UTF8"));
                         out.write(fbhtml);
                         out.close();
+                        System.out.println("Save html to "+fhfile);
                     } catch (UnsupportedEncodingException e) {
                         e.printStackTrace();
                     } catch (FileNotFoundException e) {
index 97404857607c007ffdf1e14d61e5c4383790f9c6..3720a00d31f4865673fdf4d742dbc407f86518bc 100644 (file)
@@ -454,6 +454,9 @@ class PDFTools
         if ($ignoreSeparators) {
             $out .= '/sep_' . md5($ignoreSeparators);
         }
+        if ($mode !== 'standard') {
+            $out .= '/' . $mode;
+        }
         $out = Files::mkdir($out);
 
         $fwstk = new FWSTK();
@@ -467,19 +470,24 @@ class PDFTools
             $fwstk->setArg('--ignoreSeparators "' . $ignoreSeparators . '"');
         }
         $fwstk->execute();
+
     }
 
 
     public static function extractHighlightsData($pdf, $out, $mode = 'standard')
     {
-        $out .= 'texts/';
-        Files::mkdir($out);
+        $out .= 'texts';
+        if ($mode !== 'standard') {
+            $out .= '/' . $mode;
+        }
+        $out=Files::mkdir($out);
 
         $fwstk = new FWSTK();
         $fwstk->setArg('--input ' . $pdf);
         $fwstk->setArg('--layout ' . $out . 'p%d.fby');
         $fwstk->setArg('--cmaps ' . $out);
         $fwstk->setArg('--fonts' . $out . 'fonts/web/');
+        $fwstk->setArg('--mode' . $mode);
         $fwstk->execute();
     }