From f5bc72c192c39e338d5e38088c614a39314e58ba Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Sun, 21 Aug 2011 20:36:24 +0000 Subject: [PATCH] --- .../src/org/apache/pdfbox/util/PDFStreamEngine.java | 13 +++++-------- .../apache/pdfbox/util/operator/ShowTextGlyph.java | 1 - inc/ws/Metier/class.ws.document.php | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/fluidbook/tools/fwstk/src/org/apache/pdfbox/util/PDFStreamEngine.java b/fluidbook/tools/fwstk/src/org/apache/pdfbox/util/PDFStreamEngine.java index 2759a8332..c5190e60d 100644 --- a/fluidbook/tools/fwstk/src/org/apache/pdfbox/util/PDFStreamEngine.java +++ b/fluidbook/tools/fwstk/src/org/apache/pdfbox/util/PDFStreamEngine.java @@ -82,6 +82,7 @@ public class PDFStreamEngine { private int validCharCnt; private int totalCharCnt; protected String currentString; + protected String currentOperator; /** * Flag to skip malformed or otherwise unparseable input where possible. */ @@ -156,6 +157,10 @@ public class PDFStreamEngine { currentString = s; } + public void setCurrentOperator(String s) { + currentOperator = s; + } + public boolean isForceParsing() { return forceParsing; } @@ -199,8 +204,6 @@ public class PDFStreamEngine { * @throws IOException if there is an error accessing the stream. */ public void processStream(PDPage aPage, PDResources resources, COSStream cosStream) throws IOException { - System.out.println("blabla"); - graphicsState = new PDGraphicsState(aPage.findCropBox()); textMatrix = null; textLineMatrix = null; @@ -377,10 +380,8 @@ 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(); } } @@ -407,10 +408,6 @@ public class PDFStreamEngine { } } - 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; diff --git a/fluidbook/tools/fwstk/src/org/apache/pdfbox/util/operator/ShowTextGlyph.java b/fluidbook/tools/fwstk/src/org/apache/pdfbox/util/operator/ShowTextGlyph.java index b61c6dece..5cb9b6468 100644 --- a/fluidbook/tools/fwstk/src/org/apache/pdfbox/util/operator/ShowTextGlyph.java +++ b/fluidbook/tools/fwstk/src/org/apache/pdfbox/util/operator/ShowTextGlyph.java @@ -55,7 +55,6 @@ public class ShowTextGlyph extends OperatorProcessor { } else if (next instanceof COSString) { context.setCurrentString(((COSString) next).getString()); context.processEncodedText(((COSString) next).getBytes()); - } else { throw new IOException("Unknown type in array for TJ operation:" + next); } diff --git a/inc/ws/Metier/class.ws.document.php b/inc/ws/Metier/class.ws.document.php index cb28a31b2..483641aaf 100644 --- a/inc/ws/Metier/class.ws.document.php +++ b/inc/ws/Metier/class.ws.document.php @@ -400,7 +400,7 @@ class wsDocument extends cubeMetier { $fwstk = new cubeCommandLine('fwstk'); $fwstk->setPath(CONVERTER_PATH); - $fwstk->setArg('--input ' . $this->in); + $fwstk->setArg('--input ' . $this->cropped); $fwstk->setArg('--layout ' . $this->html . 'p%d.layout'); $fwstk->setArg('--cmaps ' . $this->html); $fwstk->setArg('--fonts' . $this->out . 'fonts/web/'); -- 2.39.5