]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Sun, 21 Aug 2011 16:05:35 +0000 (16:05 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Sun, 21 Aug 2011 16:05:35 +0000 (16:05 +0000)
fluidbook/tools/convert.pe
fluidbook/tools/fwstk/nbproject/private/configs/Extract_Layout.properties
fluidbook/tools/fwstk/src/org/apache/pdfbox/util/PDFStreamEngine.java
inc/ws/Metier/class.ws.document.php

index 43c65f7069146d2407806a1fc1b73f9d4e5c4904..5980204b0ae8d3d281a871a9abc01eae5f9a57c3 100644 (file)
@@ -10,7 +10,7 @@ endloop
 
 //
 if($argv[i]!="-")
-       cmap=LoadStringFromFile()
+       cmap=LoadStringFromFile($argv[i])
        glyphs=StrSplit(cmap,"\\n");
        j=0
        while(j<SizeOf(glyphs))
index 4a5d0304df04876e98637081d5355a57d0d2d243..7927654514a0f249f0d96f3d0a705b55cdc4cca7 100644 (file)
@@ -1 +1 @@
-application.args=--input H:\\Documents\\fwstk\\layout\\document.pdf --layout H:\\Documents\\fwstk\\layout\\p%d.layout --cmaps H:\\Documents\\fwstk\\layout\\\r
+application.args=--input H:\\Documents\\fwstk\\layout\\document.pdf --layout H:\\Documents\\fwstk\\layout\\p%d.layout --fonts H:\\Documents\\fwstk\\layout\\fonts\\ --cmaps H:\\Documents\\fwstk\\layout\\\r
index 4174288e46bdee9daea786e7542fa9f8a5f9d5a7..30c61bfe5154283f521788f3f7e1df97381a2644 100644 (file)
@@ -375,17 +375,16 @@ public class PDFStreamEngine {
                                String currentChar = Character.toString(currentString.charAt(i));
                                if (!currentChar.equals(c)) {
                                        if (c.toUpperCase().equals(currentChar)) {
+                                               System.out.println("up");
                                                c = c.toUpperCase();
                                        } else if (c.toLowerCase().equals(currentChar)) {
+                                               System.out.println("low");
                                                c = c.toLowerCase();
                                        }
                                }
                        } catch (NullPointerException | StringIndexOutOfBoundsException e) {
                        }
-                       
-                       
 
-                       //System.out.println(c+";"+currentString.charAt(i));
 
                        // the space width has to be transformed into display units
                        float spaceWidthDisp = spaceWidthText * fontSizeText * horizontalScalingText * textMatrix.getValue(0, 0) * ctm.getValue(0, 0);
@@ -395,6 +394,20 @@ public class PDFStreamEngine {
                        float characterHorizontalDisplacementText = font.getFontWidth(string, i, codeLength);
                        float characterVerticalDisplacementText = font.getFontHeight(string, i, codeLength);
 
+                       PDFont ef = null;
+                       if (characterHorizontalDisplacementText == 0.0f) {
+                               ef = this.getExternalFont(font.getBaseFont());
+
+                               if (ef != null) {
+                                       characterHorizontalDisplacementText = Math.max(ef.getFontWidth(string, i, codeLength),ef.getStringWidth(c));
+                                       characterVerticalDisplacementText = ef.getFontHeight(string, i, codeLength);
+                               }
+                       }
+
+                       if (characterHorizontalDisplacementText == 0.0f && ef != null) {
+                               System.out.println(c+":"+ef.getStringWidth(c));
+                       }
+
                        // multiply the width/height with the scaling factor
                        characterHorizontalDisplacementText = characterHorizontalDisplacementText * fontMatrixXScaling;
                        characterVerticalDisplacementText = characterVerticalDisplacementText * fontMatrixYScaling;
@@ -494,6 +507,10 @@ public class PDFStreamEngine {
                }
        }
 
+       public PDFont getExternalFont(String name) {
+               return null;
+       }
+
        public void updateCmaps(String c, byte b, PDFont font) {
        }
 
index 7b707046a0026203033e95cfd55a054fcf8506dc..cb28a31b2861612d3e44185b72b9a510ccb892ee 100644 (file)
@@ -395,8 +395,15 @@ class wsDocument extends cubeMetier {
                $fwstk->setArg('--input ' . $this->cropped);\r
                $fwstk->setArg('--extractTexts ' . $this->out . '%s%d.txt');\r
                $fwstk->setArg('--extractLinks ' . $this->out . 'p%d.csv');\r
+               $fwstk->execute();\r
+               $this->addToLog($fwstk);\r
+\r
+               $fwstk = new cubeCommandLine('fwstk');\r
+               $fwstk->setPath(CONVERTER_PATH);\r
+               $fwstk->setArg('--input ' . $this->in);\r
                $fwstk->setArg('--layout ' . $this->html . 'p%d.layout');\r
                $fwstk->setArg('--cmaps ' . $this->html);\r
+               $fwstk->setArg('--fonts' . $this->out . 'fonts/web/');\r
                $fwstk->execute();\r
                $this->addToLog($fwstk);\r
 \r