]> _ Git - cubeextranet.git/commitdiff
wip #3807 @2.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 21 Jul 2020 17:49:36 +0000 (17:49 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 21 Jul 2020 17:49:36 +0000 (17:49 +0000)
fluidbook/tools/fwstk/.idea/misc.xml
fluidbook/tools/fwstk/.idea/workspace.xml
fluidbook/tools/fwstk/out/artifacts/fwstk_jar/fwstk.jar
inc/ws/Metier/class.ws.document.php
inc/ws/Util/class.ws.links.php

index 91ce3bc2157b8cf4df90c825711b4e4265b13762..4aff69c566f9433f07202f50a593d58900b57ab2 100644 (file)
@@ -3,13 +3,6 @@
   <component name="EncodingComponent">
     <option name="projectEncoding" />
   </component>
-  <component name="MavenImportPreferences">
-    <option name="generalSettings">
-      <MavenGeneralSettings>
-        <option name="mavenHome" value="Bundled (Maven 3)" />
-      </MavenGeneralSettings>
-    </option>
-  </component>
   <component name="ProjectInspectionProfilesVisibleTreeState">
     <entry key="Project Default">
       <profile-state>
index 01c13350ecbe572ac88d89c6bcf38fe3315cef78..00ef263db64b2742af9da83b03f54d967892229a 100644 (file)
@@ -7,27 +7,10 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="f146bc67-2578-4de3-9db2-94d2d43e9e83" name="Default" comment="wip #3135">
-      <change afterPath="$PROJECT_DIR$/.idea/libraries/commons_lang3_3_10.xml" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/.idea/libraries/commons_text_1_8.xml" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/lib/commons-lang3-3.10.jar" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/lib/commons-text-1.8.jar" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/out/artifacts/fwstk_jar/commons-io-2.6.jar" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/out/artifacts/fwstk_jar/commons-lang3-3.10.jar" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/out/artifacts/fwstk_jar/commons-logging-1.2.jar" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/out/artifacts/fwstk_jar/commons-text-1.8.jar" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/artifacts/fwstk_jar.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/artifacts/fwstk_jar.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/libraries/commons_text_1_6.xml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/MANIFEST.MF" beforeDir="false" afterPath="$PROJECT_DIR$/MANIFEST.MF" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/fwstk.iml" beforeDir="false" afterPath="$PROJECT_DIR$/fwstk.iml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/lib/commons-lang3-3.8.1.jar" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/lib/commons-text-1.6.jar" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/out/artifacts/fwstk_jar/commons-io-2.4.jar" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/out/artifacts/fwstk_jar/commons-logging-1.1.1.jar" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/out/artifacts/fwstk_jar/fontbox-1.8.13.jar" beforeDir="false" />
       <change beforePath="$PROJECT_DIR$/out/artifacts/fwstk_jar/fwstk.jar" beforeDir="false" afterPath="$PROJECT_DIR$/out/artifacts/fwstk_jar/fwstk.jar" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/out/artifacts/fwstk_jar/jempbox-1.8.13.jar" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/out/artifacts/fwstk_jar/pdfbox-1.8.13.jar" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/com/fluidbook/fwstk/Main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/com/fluidbook/fwstk/Main.java" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
     <property name="settings.editor.selected.configurable" value="configurable.group.language" />
   </component>
   <component name="RecentsManager">
-    <key name="MoveFile.RECENT_KEYS">
-      <recent name="H:\Works\cubeExtranet\fluidbook\tools\fwstk\out\artifacts\fwstk_jar" />
-      <recent name="H:\Works\cubeExtranet\fluidbook\tools\fwstk" />
-    </key>
     <key name="CopyFile.RECENT_KEYS">
       <recent name="H:\Works\cubeExtranet\fluidbook\tools\fwstk\lib" />
       <recent name="H:\Works\cubeExtranet\fluidbook\tools\fwstk\out\artifacts\fwstk_jar" />
     </key>
+    <key name="MoveFile.RECENT_KEYS">
+      <recent name="H:\Works\cubeExtranet\fluidbook\tools\fwstk\out\artifacts\fwstk_jar" />
+      <recent name="H:\Works\cubeExtranet\fluidbook\tools\fwstk" />
+    </key>
   </component>
-  <component name="RunManager" selected="Application.extract texts">
+  <component name="RunManager" selected="Application.extract links">
     <configuration default="true" type="Applet">
       <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
       <method v="2">
     <configuration name="extract links" type="Application" factoryName="Application">
       <option name="MAIN_CLASS_NAME" value="com.fluidbook.fwstk.Main" />
       <module name="fwstk" />
-      <option name="PROGRAM_PARAMETERS" value="--input C:\Users\Vincent\Desktop\document_002.pdf --extractLinks C:\Users\Vincent\Desktop\document_002.txt" />
-      <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
+      <option name="PROGRAM_PARAMETERS" value="--input D:\Local\Download\PNA_loutre_d_europe_2019-2028.pdf --extractLinks C:\Users\Vincent\Desktop\document_002.txt" />
+      <extension name="net.ashald.envfile">
+        <option name="IS_ENABLED" value="false" />
+        <option name="IS_SUBST" value="false" />
+        <option name="IS_PATH_MACRO_SUPPORTED" value="false" />
+        <option name="IS_IGNORE_MISSING_FILES" value="false" />
+        <option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
+        <ENTRIES>
+          <ENTRY IS_ENABLED="true" PARSER="runconfig" />
+        </ENTRIES>
+      </extension>
       <method v="2">
         <option name="Make" enabled="true" />
       </method>
       <workItem from="1570806151720" duration="850000" />
       <workItem from="1575379759151" duration="1198000" />
       <workItem from="1589879021642" duration="2421000" />
+      <workItem from="1595346736329" duration="5317000" />
     </task>
     <task id="LOCAL-00001" summary="wip #1111 @0.5">
       <created>1487172253077</created>
     <option name="LAST_COMMIT_MESSAGE" value="wip #3135" />
   </component>
   <component name="WindowStateProjectService">
+    <state x="2069" y="315" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1595347379052">
+      <screen x="1920" y="0" width="1920" height="1160" />
+    </state>
+    <state x="2069" y="315" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1920.1160/-1920.0.1920.1160/1920.0.1920.1160@1920.0.1920.1160" timestamp="1595347379052" />
+    <state x="743" y="448" width="433" height="269" key="#com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesDialog.classes" timestamp="1595346997744">
+      <screen x="0" y="0" width="1920" height="1160" />
+    </state>
+    <state x="743" y="448" width="433" height="269" key="#com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesDialog.classes/0.0.1920.1160/-1920.0.1920.1160/1920.0.1920.1160@0.0.1920.1160" timestamp="1595346997744" />
     <state x="666" y="321" key="FileChooserDialogImpl" timestamp="1589879749332">
       <screen x="0" y="0" width="1920" height="1160" />
     </state>
     <state x="666" y="321" key="FileChooserDialogImpl/0.0.1920.1160/-1920.0.1920.1160/1920.0.1920.1160@0.0.1920.1160" timestamp="1589879749332" />
+    <state width="1877" height="312" key="GridCell.Tab.0.bottom" timestamp="1595350861117">
+      <screen x="1920" y="0" width="1920" height="1160" />
+    </state>
+    <state width="1877" height="312" key="GridCell.Tab.0.bottom/0.0.1920.1160/-1920.0.1920.1160/1920.0.1920.1160@1920.0.1920.1160" timestamp="1595350861117" />
+    <state width="1877" height="312" key="GridCell.Tab.0.center" timestamp="1595350861117">
+      <screen x="1920" y="0" width="1920" height="1160" />
+    </state>
+    <state width="1877" height="312" key="GridCell.Tab.0.center/0.0.1920.1160/-1920.0.1920.1160/1920.0.1920.1160@1920.0.1920.1160" timestamp="1595350861117" />
+    <state width="1877" height="312" key="GridCell.Tab.0.left" timestamp="1595350861117">
+      <screen x="1920" y="0" width="1920" height="1160" />
+    </state>
+    <state width="1877" height="312" key="GridCell.Tab.0.left/0.0.1920.1160/-1920.0.1920.1160/1920.0.1920.1160@1920.0.1920.1160" timestamp="1595350861117" />
+    <state width="1877" height="312" key="GridCell.Tab.0.right" timestamp="1595350861117">
+      <screen x="1920" y="0" width="1920" height="1160" />
+    </state>
+    <state width="1877" height="312" key="GridCell.Tab.0.right/0.0.1920.1160/-1920.0.1920.1160/1920.0.1920.1160@1920.0.1920.1160" timestamp="1595350861117" />
     <state x="440" y="154" key="SettingsEditor" timestamp="1589880115786">
       <screen x="0" y="0" width="1920" height="1160" />
     </state>
index 9111447a07c5e579bda2c8c3a3d9bb91211168f2..e77b60ace6c8acd88c104e8e03e99f932f43d012 100644 (file)
Binary files a/fluidbook/tools/fwstk/out/artifacts/fwstk_jar/fwstk.jar and b/fluidbook/tools/fwstk/out/artifacts/fwstk_jar/fwstk.jar differ
index f4e69dc2d2df4ac6f5903c4b30336fffdb25da03..e30cd1b71ac68f4b930def9da9353f2590522778 100644 (file)
@@ -338,10 +338,26 @@ class wsDocument extends cubeMetier
         $pdftk->setPath(CONVERTER_PATH);
         $pdftk->setArg(null, $this->getCroppedPDF());
         $pdftk->setArg(null, 'burst');
+        $pdftk->setArg(null, 'uncompress');
         $pdftk->setArg(null, 'output');
         $pdftk->setArg(null, $this->out . 'pdf/p%d.pdf');
         $pdftk->execute();
         $this->addToLog($pdftk);
+
+        for ($i = 1; $i <= $this->getPagesNumber(); $i++) {
+            // Remove annotations : https://gist.github.com/stefanschmidt/5248592
+            $file = sprintf($this->out . 'pdf/p%d.pdf', $i);
+            $to = sprintf($this->out . 'pdf/s%d.pdf', $i);
+            `LANG=C LC_CTYPE=C sed -n '/^\/Annots/!p' $file > $to`;
+            if (file_exists($to)) {
+                if (filesize($to) > 0) {
+                    unlink($file);
+                    rename($to, $file);
+                } else {
+                    unlink($to);
+                }
+            }
+        }
     }
 
     public function CropAndCut()
index aef5e13fe87b94198389a62bae1ab7dde9dae5b7..cf5a9300fa6ba5f91bd056b938d226bb7ed37df0 100644 (file)
@@ -150,7 +150,7 @@ class wsLinks
 
     public static function getLinksAndRulers($book_id, &$links, &$rulers, $time = null)
     {
-        return self::getLinksAndRulersFromFile($book_id,$links,$rulers,$time);
+        return self::getLinksAndRulersFromFile($book_id, $links, $rulers, $time);
     }
 
     public static function getLinksAndRulersFromFile($book_id, &$links, &$rulers, $time = 'latest')
@@ -456,7 +456,7 @@ class wsLinks
                 }
                 $link = [];
                 if ($newformat) {
-                    $cols = array('page' => '', 'left' => '', 'top' => '', 'width' => '', 'height' => '', 'type' => '', 'to' => '', 'target' => '_blank', 'video_loop' => true, 'video_auto_start' => true, 'video_controls' => true, 'video_sound_on' => true, 'infobulle' => '', 'numerotation' => 'physical');
+                    $cols = array('page' => '', 'left' => '', 'top' => '', 'width' => '', 'height' => '', 'type' => '', 'to' => '', 'target' => '_blank', 'video_loop' => true, 'video_auto_start' => true, 'video_controls' => true, 'video_sound_on' => true, 'infobulle' => '', 'numerotation' => 'physical', "inline" => true);
                 } else {
                     $cols = array('page' => '', 'type' => '', 'to' => '', 'left' => '', 'top' => '', 'width' => '', 'height' => '', 'target' => '_blank', 'video_loop' => true, 'video_auto_start' => true, 'video_controls' => true, 'video_sound_on' => true, 'infobulle' => '', 'numerotation' => 'physical');
                 }
@@ -477,6 +477,12 @@ class wsLinks
                     }
                     $k++;
                 }
+
+                if ($link['type'] == 18) {
+                    $link['infobulle'] = $link['to'];
+                    $link['to'] = '';
+                }
+
                 $link['page'] = $page;
                 $links[] = $link;
             }