pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jahew...@apache.org
Subject svn commit: r1626070 [2/2] - in /pdfbox/trunk: examples/src/main/java/org/apache/pdfbox/examples/util/ pdfbox/src/main/java/org/apache/pdfbox/encoding/ pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fon...
Date Thu, 18 Sep 2014 20:14:19 GMT
Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetGraphicsStateParameters.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetGraphicsStateParameters.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetGraphicsStateParameters.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetGraphicsStateParameters.java Thu Sep 18 20:14:17 2014
@@ -41,4 +41,10 @@ public class SetGraphicsStateParameters 
         PDExtendedGraphicsState gs = context.getGraphicsStates().get( graphicsName.getName() );
         gs.copyIntoGraphicsState( context.getGraphicsState() );
     }
+
+    @Override
+    public String getName()
+    {
+        return "gs";
+    }
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineCapStyle.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineCapStyle.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineCapStyle.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineCapStyle.java Thu Sep 18 20:14:17 2014
@@ -38,4 +38,10 @@ public class SetLineCapStyle extends Ope
         int lineCapStyle = ((COSNumber)arguments.get( 0 )).intValue();
         context.getGraphicsState().setLineCap( lineCapStyle );
     }
+
+    @Override
+    public String getName()
+    {
+        return "J";
+    }
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineDashPattern.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineDashPattern.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineDashPattern.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineDashPattern.java Thu Sep 18 20:14:17 2014
@@ -53,4 +53,10 @@ public class SetLineDashPattern extends 
         PDLineDashPattern lineDash = new PDLineDashPattern(dashArray, dashPhase);
         context.getGraphicsState().setLineDashPattern(lineDash);
     }
+
+    @Override
+    public String getName()
+    {
+        return "d";
+    }
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineJoinStyle.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineJoinStyle.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineJoinStyle.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineJoinStyle.java Thu Sep 18 20:14:17 2014
@@ -38,4 +38,10 @@ public class SetLineJoinStyle extends Op
         int lineJoinStyle = ((COSNumber)arguments.get( 0 )).intValue();
         context.getGraphicsState().setLineJoin( lineJoinStyle );
     }
+
+    @Override
+    public String getName()
+    {
+        return "j";
+    }
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineMiterLimit.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineMiterLimit.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineMiterLimit.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineMiterLimit.java Thu Sep 18 20:14:17 2014
@@ -38,4 +38,10 @@ public class SetLineMiterLimit extends O
         COSNumber miterLimit = (COSNumber)arguments.get( 0 );
         context.getGraphicsState().setMiterLimit( miterLimit.floatValue() );
     }
+
+    @Override
+    public String getName()
+    {
+        return "w";
+    }
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineWidth.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineWidth.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineWidth.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineWidth.java Thu Sep 18 20:14:17 2014
@@ -38,4 +38,10 @@ public class SetLineWidth extends Operat
         COSNumber width = (COSNumber)arguments.get( 0 );
         context.getGraphicsState().setLineWidth( width.floatValue() );
     }
+
+    @Override
+    public String getName()
+    {
+        return "w";
+    }
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetMatrix.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetMatrix.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetMatrix.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetMatrix.java Thu Sep 18 20:14:17 2014
@@ -52,4 +52,10 @@ public class SetMatrix extends OperatorP
         context.setTextMatrix( textMatrix );
         context.setTextLineMatrix( textMatrix.clone() );
     }
+
+    @Override
+    public String getName()
+    {
+        return "Tm";
+    }
 }

Added: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetRenderingIntent.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetRenderingIntent.java?rev=1626070&view=auto
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetRenderingIntent.java (added)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetRenderingIntent.java Thu Sep 18 20:14:17 2014
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.pdfbox.util.operator.state;
+
+import java.io.IOException;
+import java.util.List;
+import org.apache.pdfbox.cos.COSBase;
+import org.apache.pdfbox.cos.COSName;
+import org.apache.pdfbox.util.operator.Operator;
+import org.apache.pdfbox.util.operator.OperatorProcessor;
+
+/**
+ * ri: Set the rendering intent.
+ *
+ * @author John Hewson
+ */
+public class SetRenderingIntent extends OperatorProcessor
+{
+    @Override
+    public void process(Operator operator, List<COSBase> operands) throws IOException
+    {
+        COSName value = (COSName)operands.get(0);
+        context.getGraphicsState().setRenderingIntent(value.getName());
+    }
+
+    @Override
+    public String getName()
+    {
+        return "ri";
+    }
+}

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/BeginText.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/BeginText.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/BeginText.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/BeginText.java Thu Sep 18 20:14:17 2014
@@ -39,4 +39,10 @@ public class BeginText extends OperatorP
         context.setTextLineMatrix( new Matrix() );
         context.beginText();
     }
+
+    @Override
+    public String getName()
+    {
+        return "BT";
+    }
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/EndText.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/EndText.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/EndText.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/EndText.java Thu Sep 18 20:14:17 2014
@@ -37,4 +37,10 @@ public class EndText extends OperatorPro
         context.setTextLineMatrix(null);
         context.endText();
     }
+
+    @Override
+    public String getName()
+    {
+        return "ET";
+    }
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/MoveText.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/MoveText.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/MoveText.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/MoveText.java Thu Sep 18 20:14:17 2014
@@ -42,4 +42,10 @@ public class MoveText extends OperatorPr
         context.setTextLineMatrix( td.multiply( context.getTextLineMatrix() ) );
         context.setTextMatrix( context.getTextLineMatrix().clone() );
     }
+
+    @Override
+    public String getName()
+    {
+        return "Td";
+    }
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/MoveTextSetLeading.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/MoveTextSetLeading.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/MoveTextSetLeading.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/MoveTextSetLeading.java Thu Sep 18 20:14:17 2014
@@ -44,4 +44,10 @@ public class MoveTextSetLeading extends 
         context.processOperator("TL", args);
         context.processOperator("Td", arguments);
     }
+
+    @Override
+    public String getName()
+    {
+        return "TD";
+    }
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/NextLine.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/NextLine.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/NextLine.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/NextLine.java Thu Sep 18 20:14:17 2014
@@ -44,4 +44,10 @@ public class NextLine extends OperatorPr
         // use Td instead of repeating code
         context.processOperator("Td", args);
     }
+
+    @Override
+    public String getName()
+    {
+        return "T*";
+    }
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetCharSpacing.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetCharSpacing.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetCharSpacing.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetCharSpacing.java Thu Sep 18 20:14:17 2014
@@ -47,4 +47,10 @@ public class SetCharSpacing extends Oper
             }
         }
     }
+
+    @Override
+    public String getName()
+    {
+        return "Tc";
+    }
 }

Added: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetFontAndSize.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetFontAndSize.java?rev=1626070&view=auto
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetFontAndSize.java (added)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetFontAndSize.java Thu Sep 18 20:14:17 2014
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.pdfbox.util.operator.text;
+
+import java.util.List;
+
+import org.apache.pdfbox.cos.COSBase;
+import org.apache.pdfbox.cos.COSName;
+import org.apache.pdfbox.cos.COSNumber;
+import org.apache.pdfbox.util.operator.Operator;
+import org.apache.pdfbox.util.operator.OperatorProcessor;
+
+import java.io.IOException;
+
+/**
+ * Tf: Set text font and size.
+ *
+ * @author Laurent Huault
+ */
+public class SetFontAndSize extends OperatorProcessor
+{
+    @Override
+    public void process(Operator operator, List<COSBase> arguments) throws IOException
+    {
+        // there are some documents that are incorrectly structured and
+        // arguments are in the wrong spot, so we will silently ignore them
+        // if there are no arguments
+        if( arguments.size() >= 2 )
+        {
+            // set font and size
+            COSName fontName = (COSName)arguments.get( 0 );
+            float fontSize = ((COSNumber)arguments.get( 1 ) ).floatValue();
+            context.getGraphicsState().getTextState().setFontSize( fontSize );
+            context.getGraphicsState().getTextState().setFont( context.getFonts().get( fontName.getName() ) );
+        }
+    }
+
+    @Override
+    public String getName()
+    {
+        return "Tf";
+    }
+}

Copied: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetTextHorizontalScaling.java (from r1625710, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetHorizontalTextScaling.java)
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetTextHorizontalScaling.java?p2=pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetTextHorizontalScaling.java&p1=pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetHorizontalTextScaling.java&r1=1625710&r2=1626070&rev=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetHorizontalTextScaling.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetTextHorizontalScaling.java Thu Sep 18 20:14:17 2014
@@ -30,7 +30,7 @@ import java.io.IOException;
  *
  * @author Ben Litchfield
  */
-public class SetHorizontalTextScaling extends OperatorProcessor
+public class SetTextHorizontalScaling extends OperatorProcessor
 {
     @Override
     public void process(Operator operator, List<COSBase> arguments) throws IOException
@@ -38,4 +38,10 @@ public class SetHorizontalTextScaling ex
         COSNumber scaling = (COSNumber)arguments.get(0);
         context.getGraphicsState().getTextState().setHorizontalScaling(scaling.floatValue());
     }
+
+    @Override
+    public String getName()
+    {
+        return "Tz";
+    }
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetTextLeading.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetTextLeading.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetTextLeading.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetTextLeading.java Thu Sep 18 20:14:17 2014
@@ -36,4 +36,10 @@ public class SetTextLeading extends Oper
         COSNumber leading = (COSNumber)arguments.get( 0 );
         context.getGraphicsState().getTextState().setLeading( leading.floatValue() );
     }
+
+    @Override
+    public String getName()
+    {
+        return "TL";
+    }
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetTextRenderingMode.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetTextRenderingMode.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetTextRenderingMode.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetTextRenderingMode.java Thu Sep 18 20:14:17 2014
@@ -40,4 +40,10 @@ public class SetTextRenderingMode extend
         RenderingMode renderingMode = RenderingMode.fromInt(mode.intValue());
         context.getGraphicsState().getTextState().setRenderingMode(renderingMode);
     }
+
+    @Override
+    public String getName()
+    {
+        return "Tr";
+    }
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetTextRise.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetTextRise.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetTextRise.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetTextRise.java Thu Sep 18 20:14:17 2014
@@ -38,4 +38,10 @@ public class SetTextRise extends Operato
         COSNumber rise = (COSNumber)arguments.get(0);
         context.getGraphicsState().getTextState().setRise( rise.floatValue() );
     }
+
+    @Override
+    public String getName()
+    {
+        return "Ts";
+    }
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetWordSpacing.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetWordSpacing.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetWordSpacing.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetWordSpacing.java Thu Sep 18 20:14:17 2014
@@ -36,4 +36,10 @@ public class SetWordSpacing extends Oper
         COSNumber wordSpacing = (COSNumber)arguments.get( 0 );
         context.getGraphicsState().getTextState().setWordSpacing( wordSpacing.floatValue() );
     }
+
+    @Override
+    public String getName()
+    {
+        return "Tw";
+    }
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/ShowText.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/ShowText.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/ShowText.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/ShowText.java Thu Sep 18 20:14:17 2014
@@ -38,4 +38,10 @@ public class ShowText extends OperatorPr
         COSString string = (COSString)arguments.get( 0 );
         context.showTextString(string.getBytes());
     }
+
+    @Override
+    public String getName()
+    {
+        return "Tj";
+    }
 }

Copied: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/ShowTextAdjusted.java (from r1625710, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/ShowTextGlyph.java)
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/ShowTextAdjusted.java?p2=pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/ShowTextAdjusted.java&p1=pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/ShowTextGlyph.java&r1=1625710&r2=1626070&rev=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/ShowTextGlyph.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/ShowTextAdjusted.java Thu Sep 18 20:14:17 2014
@@ -29,7 +29,7 @@ import org.apache.pdfbox.util.operator.O
  *
  * @author Laurent Huault
  */
-public class ShowTextGlyph extends OperatorProcessor
+public class ShowTextAdjusted extends OperatorProcessor
 {
     @Override
     public void process(Operator operator, List<COSBase> arguments) throws IOException
@@ -37,4 +37,10 @@ public class ShowTextGlyph extends Opera
         COSArray array = (COSArray)arguments.get(0);
         context.showTextStrings(array);
     }
+
+    @Override
+    public String getName()
+    {
+        return "TJ";
+    }
 }

Copied: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/ShowTextLine.java (from r1625710, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/MoveAndShow.java)
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/ShowTextLine.java?p2=pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/ShowTextLine.java&p1=pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/MoveAndShow.java&r1=1625710&r2=1626070&rev=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/MoveAndShow.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/ShowTextLine.java Thu Sep 18 20:14:17 2014
@@ -29,7 +29,7 @@ import java.io.IOException;
  *
  * @author Laurent Huault
  */
-public class MoveAndShow extends OperatorProcessor
+public class ShowTextLine extends OperatorProcessor
 {
     @Override
     public void process(Operator operator, List<COSBase> arguments) throws IOException
@@ -37,4 +37,10 @@ public class MoveAndShow extends Operato
         context.processOperator("T*", null);
         context.processOperator("Tj", arguments);
     }
+
+    @Override
+    public String getName()
+    {
+        return "'";
+    }
 }

Copied: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/ShowTextLineAndSpace.java (from r1625710, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetMoveAndShow.java)
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/ShowTextLineAndSpace.java?p2=pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/ShowTextLineAndSpace.java&p1=pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetMoveAndShow.java&r1=1625710&r2=1626070&rev=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetMoveAndShow.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/ShowTextLineAndSpace.java Thu Sep 18 20:14:17 2014
@@ -29,7 +29,7 @@ import java.io.IOException;
  *
  * @author Laurent Huault
  */
-public class SetMoveAndShow extends OperatorProcessor
+public class ShowTextLineAndSpace extends OperatorProcessor
 {
     @Override
     public void process(Operator operator, List<COSBase> arguments) throws IOException
@@ -38,4 +38,10 @@ public class SetMoveAndShow extends Oper
         context.processOperator("Tc", arguments.subList(1,2));
         context.processOperator("'", arguments.subList(2,3));
     }
+
+    @Override
+    public String getName()
+    {
+        return "\"";
+    }
 }

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/edit/TestPDPageContentStream.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/edit/TestPDPageContentStream.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/edit/TestPDPageContentStream.java (original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/edit/TestPDPageContentStream.java Thu Sep 18 20:14:17 2014
@@ -58,7 +58,7 @@ public class TestPDPageContentStream ext
         assertEquals(0.2f, ((COSFloat)pageTokens.get(1)).floatValue());
         assertEquals(0.3f, ((COSFloat)pageTokens.get(2)).floatValue());
         assertEquals(0.4f, ((COSFloat)pageTokens.get(3)).floatValue());
-        assertEquals("k", ((Operator) pageTokens.get(4)).getOperation());
+        assertEquals("k", ((Operator) pageTokens.get(4)).getName());
 
         // same as above but for PDPageContentStream#setStrokingColor
         page = new PDPage();
@@ -84,6 +84,6 @@ public class TestPDPageContentStream ext
         assertEquals(0.6f, ((COSFloat)pageTokens.get(1)).floatValue());
         assertEquals(0.7f, ((COSFloat)pageTokens.get(2)).floatValue());
         assertEquals(0.8f, ((COSFloat)pageTokens.get(3)).floatValue());
-        assertEquals("K", ((Operator)pageTokens.get(4)).getOperation());
+        assertEquals("K", ((Operator)pageTokens.get(4)).getName());
     }
 }

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightContentStream.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightContentStream.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightContentStream.java (original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightContentStream.java Thu Sep 18 20:14:17 2014
@@ -32,6 +32,7 @@ import java.io.InputStream;
 import java.util.List;
 
 import org.apache.pdfbox.cos.COSArray;
+import org.apache.pdfbox.cos.COSBase;
 import org.apache.pdfbox.cos.COSDictionary;
 import org.apache.pdfbox.cos.COSFloat;
 import org.apache.pdfbox.cos.COSInteger;
@@ -51,7 +52,6 @@ import org.apache.pdfbox.preflight.excep
 import org.apache.pdfbox.preflight.font.container.FontContainer;
 import org.apache.pdfbox.preflight.font.util.GlyphException;
 import org.apache.pdfbox.util.operator.Operator;
-import org.apache.pdfbox.util.operator.OperatorProcessor;
 
 public class PreflightContentStream extends PreflightStreamEngine
 {
@@ -136,47 +136,36 @@ public class PreflightContentStream exte
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.pdfbox.util.PDFStreamEngine#processOperator(org.apache.pdfbox .util.PDFOperator, java.util.List)
-     */
-    protected void processOperator(Operator operator, List arguments) throws IOException
+    @Override
+    protected void processOperator(Operator operator, List<COSBase> arguments) throws IOException
     {
-        /*
-         * Here is a copy of the super method because the else block is different. (If the operator is unknown, throw an
-         * exception)
-         */
-        String operation = operator.getOperation();
-        OperatorProcessor processor = (OperatorProcessor) contentStreamEngineOperators.get(operation);
-        if (processor != null)
-        {
-            processor.setContext(this);
-            processor.process(operator, arguments);
-        }
-        else
-        {
-            registerError("The operator \"" + operation + "\" isn't supported.",
-                    ERROR_SYNTAX_CONTENT_STREAM_UNSUPPORTED_OP);
-            return;
-        }
+        super.processOperator(operator, arguments);
+
+        // todo: why are the checks below done here and not in OperatorProcessor classes?
 
         /*
-         * Process Specific Validation. The Generic Processing is useless for PDFA validation
+         * Process Specific Validation. The Generic Processing is useless for PDF/A validation
          */
-        if ("BI".equals(operation))
+        if ("BI".equals(operator.getName()))
         {
             validImageFilter(operator);
             validImageColorSpace(operator);
         }
 
         checkShowTextOperators(operator, arguments);
-        checkColorOperators(operation);
+        checkColorOperators(operator.getName());
         validRenderingIntent(operator, arguments);
         checkSetColorSpaceOperators(operator, arguments);
         validNumberOfGraphicStates(operator);
     }
 
+    @Override
+    protected void unsupportedOperator(Operator operator, List<COSBase> arguments)
+    {
+        registerError("The operator \"" + operator.getName() + "\" isn't supported.",
+                ERROR_SYNTAX_CONTENT_STREAM_UNSUPPORTED_OP);
+    }
+
     /**
      * Process Text Validation. According to the operator one of the both method will be called.
      * (validStringDefinition(PDFOperator operator, List<?> arguments) / validStringArray(PDFOperator operator, List<?>
@@ -190,7 +179,7 @@ public class PreflightContentStream exte
     protected void checkShowTextOperators(Operator operator, List<?> arguments) throws ContentStreamException,
             IOException
     {
-        String op = operator.getOperation();
+        String op = operator.getName();
         if ("Tj".equals(op) || "'".equals(op) || "\"".equals(op))
         {
             validStringDefinition(operator, arguments);
@@ -219,11 +208,11 @@ public class PreflightContentStream exte
         /*
          * For a Text operator, the arguments list should contain only one COSString object
          */
-        if ("\"".equals(operator.getOperation()))
+        if ("\"".equals(operator.getName()))
         {
             if (arguments.size() != 3)
             {
-                registerError("Invalid argument for the operator : " + operator.getOperation(),
+                registerError("Invalid argument for the operator : " + operator.getName(),
                         ERROR_SYNTAX_CONTENT_STREAM_INVALID_ARGUMENT);
                 return;
             }
@@ -233,7 +222,7 @@ public class PreflightContentStream exte
             if (!(arg0 instanceof COSInteger || arg0 instanceof COSFloat)
                     || !(arg1 instanceof COSInteger || arg1 instanceof COSFloat))
             {
-                registerError("Invalid argument for the operator : " + operator.getOperation(),
+                registerError("Invalid argument for the operator : " + operator.getName(),
                         ERROR_SYNTAX_CONTENT_STREAM_INVALID_ARGUMENT);
                 return;
             }
@@ -244,7 +233,7 @@ public class PreflightContentStream exte
             }
             else
             {
-                registerError("Invalid argument for the operator : " + operator.getOperation(),
+                registerError("Invalid argument for the operator : " + operator.getName(),
                         ERROR_SYNTAX_CONTENT_STREAM_INVALID_ARGUMENT);
                 return;
             }
@@ -258,7 +247,7 @@ public class PreflightContentStream exte
             }
             else if (!(objStr instanceof COSInteger))
             {
-                registerError("Invalid argument for the operator : " + operator.getOperation(),
+                registerError("Invalid argument for the operator : " + operator.getName(),
                         ERROR_SYNTAX_CONTENT_STREAM_INVALID_ARGUMENT);
                 return;
             }
@@ -290,7 +279,7 @@ public class PreflightContentStream exte
             }
             else if (!(object instanceof COSInteger || object instanceof COSFloat))
             {
-                registerError("Invalid argument for the operator : " + operator.getOperation(),
+                registerError("Invalid argument for the operator : " + operator.getName(),
                         ERROR_SYNTAX_CONTENT_STREAM_INVALID_ARGUMENT);
                 return;
             }

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightStreamEngine.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightStreamEngine.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightStreamEngine.java (original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightStreamEngine.java Thu Sep 18 20:14:17 2014
@@ -30,7 +30,6 @@ import static org.apache.pdfbox.prefligh
 
 import java.awt.color.ICC_ColorSpace;
 import java.io.IOException;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -58,6 +57,8 @@ import org.apache.pdfbox.preflight.utils
 import org.apache.pdfbox.util.operator.DrawObject;
 import org.apache.pdfbox.util.operator.Operator;
 import org.apache.pdfbox.util.PDFStreamEngine;
+import org.apache.pdfbox.util.operator.color.SetNonStrokingColorN;
+import org.apache.pdfbox.util.operator.color.SetStrokingColorN;
 import org.apache.pdfbox.util.operator.text.BeginText;
 import org.apache.pdfbox.util.operator.state.Concatenate;
 import org.apache.pdfbox.util.operator.text.EndText;
@@ -66,9 +67,9 @@ import org.apache.pdfbox.util.operator.s
 import org.apache.pdfbox.util.operator.text.MoveText;
 import org.apache.pdfbox.util.operator.text.MoveTextSetLeading;
 import org.apache.pdfbox.util.operator.text.NextLine;
-import org.apache.pdfbox.util.operator.OperatorProcessor;
 import org.apache.pdfbox.util.operator.text.SetCharSpacing;
-import org.apache.pdfbox.util.operator.text.SetHorizontalTextScaling;
+import org.apache.pdfbox.util.operator.text.SetFontAndSize;
+import org.apache.pdfbox.util.operator.text.SetTextHorizontalScaling;
 import org.apache.pdfbox.util.operator.state.SetLineCapStyle;
 import org.apache.pdfbox.util.operator.state.SetLineDashPattern;
 import org.apache.pdfbox.util.operator.state.SetLineJoinStyle;
@@ -82,7 +83,6 @@ import org.apache.pdfbox.util.operator.c
 import org.apache.pdfbox.util.operator.color.SetStrokingColor;
 import org.apache.pdfbox.util.operator.color.SetStrokingColorSpace;
 import org.apache.pdfbox.util.operator.color.SetStrokingDeviceRGBColor;
-import org.apache.pdfbox.util.operator.text.SetTextFont;
 import org.apache.pdfbox.util.operator.text.SetTextLeading;
 import org.apache.pdfbox.util.operator.text.SetTextRenderingMode;
 import org.apache.pdfbox.util.operator.text.SetTextRise;
@@ -100,13 +100,9 @@ public abstract class PreflightStreamEng
     }
 
     protected PreflightContext context = null;
-
     protected COSDocument cosDocument = null;
-
     protected PDPage processeedPage = null;
 
-    protected Map<String, OperatorProcessor> contentStreamEngineOperators = new HashMap<String, OperatorProcessor>();
-
     public PreflightStreamEngine(PreflightContext _context, PDPage _page)
     {
         super();
@@ -115,109 +111,102 @@ public abstract class PreflightStreamEng
         this.processeedPage = _page;
 
         // Graphics operators
-        registerOperatorProcessor("w", new SetLineWidth());
-        registerOperatorProcessor("cm", new Concatenate());
+        addOperator(new SetLineWidth());
+        addOperator(new Concatenate());
 
-        registerOperatorProcessor("CS", new SetStrokingColorSpace());
-        registerOperatorProcessor("cs", new SetNonStrokingColorSpace());
-        registerOperatorProcessor("d", new SetLineDashPattern());
-        registerOperatorProcessor("Do", new DrawObject());
-
-        registerOperatorProcessor("j", new SetLineJoinStyle());
-        registerOperatorProcessor("J", new SetLineCapStyle());
-        registerOperatorProcessor("K", new SetStrokingDeviceCMYKColor());
-        registerOperatorProcessor("k", new SetNonStrokingDeviceCMYKColor());
-
-        registerOperatorProcessor("rg", new SetNonStrokingDeviceRGBColor());
-        registerOperatorProcessor("RG", new SetStrokingDeviceRGBColor());
-
-        registerOperatorProcessor("SC", new SetStrokingColor());
-        registerOperatorProcessor("SCN", new SetStrokingColor());
-        registerOperatorProcessor("sc", new SetNonStrokingColor());
-        registerOperatorProcessor("scn", new SetNonStrokingColor());
+        addOperator(new SetStrokingColorSpace());
+        addOperator(new SetNonStrokingColorSpace());
+        addOperator(new SetLineDashPattern());
+        addOperator(new DrawObject());
+
+        addOperator(new SetLineJoinStyle());
+        addOperator(new SetLineCapStyle());
+        addOperator(new SetStrokingDeviceCMYKColor());
+        addOperator( new SetNonStrokingDeviceCMYKColor());
+
+        addOperator(new SetNonStrokingDeviceRGBColor());
+        addOperator(new SetStrokingDeviceRGBColor());
+
+        addOperator(new SetStrokingColor());
+        addOperator(new SetStrokingColorN());
+        addOperator(new SetNonStrokingColor());
+        addOperator( new SetNonStrokingColorN());
 
         // Graphics state
-        registerOperatorProcessor("Q", new Restore());
-        registerOperatorProcessor("q", new Save());
+        addOperator(new Restore());
+        addOperator(new Save());
 
         // Text operators
-        registerOperatorProcessor("BT", new BeginText());
-        registerOperatorProcessor("ET", new EndText());
-        registerOperatorProcessor("Tf", new SetTextFont());
-        registerOperatorProcessor("Tr", new SetTextRenderingMode());
-        registerOperatorProcessor("Tm", new SetMatrix());
-        registerOperatorProcessor("Td", new MoveText());
-        registerOperatorProcessor("T*", new NextLine());
-        registerOperatorProcessor("TD", new MoveTextSetLeading());
-        registerOperatorProcessor("Tc", new SetCharSpacing());
-        registerOperatorProcessor("TL", new SetTextLeading());
-        registerOperatorProcessor("Ts", new SetTextRise());
-        registerOperatorProcessor("Tw", new SetWordSpacing());
-        registerOperatorProcessor("Tz", new SetHorizontalTextScaling());
+        addOperator(new BeginText());
+        addOperator(new EndText());
+        addOperator(new SetFontAndSize());
+        addOperator(new SetTextRenderingMode());
+        addOperator(new SetMatrix());
+        addOperator(new MoveText());
+        addOperator(new NextLine());
+        addOperator(new MoveTextSetLeading());
+        addOperator(new SetCharSpacing());
+        addOperator(new SetTextLeading());
+        addOperator(new SetTextRise());
+        addOperator(new SetWordSpacing());
+        addOperator(new SetTextHorizontalScaling());
 
         /*
          * Do not use the PDFBox Operator, because of the PageDrawer class cast Or because the Operator doesn't exist
          */
-        StubOperator stubOp = new StubOperator();
-        registerOperatorProcessor("l", stubOp);
-        registerOperatorProcessor("re", stubOp);
-        registerOperatorProcessor("c", stubOp);
-        registerOperatorProcessor("y", stubOp);
-        registerOperatorProcessor("v", stubOp);
-        registerOperatorProcessor("n", stubOp);
-        registerOperatorProcessor("BI", stubOp);
-        registerOperatorProcessor("ID", stubOp);
-        registerOperatorProcessor("EI", stubOp);
-        registerOperatorProcessor("m", stubOp);
-        registerOperatorProcessor("W*", stubOp);
-        registerOperatorProcessor("W", stubOp);
-        registerOperatorProcessor("h", stubOp);
-
-        registerOperatorProcessor("Tj", stubOp);
-        registerOperatorProcessor("TJ", stubOp);
-        registerOperatorProcessor("'", stubOp);
-        registerOperatorProcessor("\"", stubOp);
-
-        registerOperatorProcessor("b", stubOp);
-        registerOperatorProcessor("B", stubOp);
-        registerOperatorProcessor("b*", stubOp);
-        registerOperatorProcessor("B*", stubOp);
-
-        registerOperatorProcessor("BDC", stubOp);
-        registerOperatorProcessor("BMC", stubOp);
-        registerOperatorProcessor("DP", stubOp);
-        registerOperatorProcessor("EMC", stubOp);
-        registerOperatorProcessor("BX", stubOp);
-        registerOperatorProcessor("EX", stubOp);
-
-        registerOperatorProcessor("d0", stubOp);
-        registerOperatorProcessor("d1", stubOp);
-
-        registerOperatorProcessor("f", stubOp);
-        registerOperatorProcessor("F", stubOp);
-        registerOperatorProcessor("f*", stubOp);
-
-        registerOperatorProcessor("g", stubOp);
-        registerOperatorProcessor("G", stubOp);
-
-        registerOperatorProcessor("M", stubOp);
-        registerOperatorProcessor("MP", stubOp);
-
-        registerOperatorProcessor("gs", stubOp);
-        registerOperatorProcessor("h", stubOp);
-        registerOperatorProcessor("i", stubOp);
-
-        registerOperatorProcessor("ri", stubOp);
-        registerOperatorProcessor("s", stubOp);
-        registerOperatorProcessor("S", stubOp);
-        registerOperatorProcessor("sh", stubOp);
-    }
 
-    @Override
-    public final void registerOperatorProcessor(String operator, OperatorProcessor op)
-    {
-        super.registerOperatorProcessor(operator, op);
-        contentStreamEngineOperators.put(operator, op);
+        addOperator(new StubOperator("l"));
+        addOperator(new StubOperator("re"));
+        addOperator(new StubOperator("c"));
+        addOperator(new StubOperator("y"));
+        addOperator(new StubOperator("v"));
+        addOperator(new StubOperator("n"));
+        addOperator(new StubOperator("BI"));
+        addOperator(new StubOperator("ID"));
+        addOperator(new StubOperator("EI"));
+        addOperator(new StubOperator("m"));
+        addOperator(new StubOperator("W*"));
+        addOperator(new StubOperator("W"));
+        addOperator(new StubOperator("h"));
+
+        addOperator(new StubOperator("Tj"));
+        addOperator(new StubOperator("TJ"));
+        addOperator(new StubOperator("'"));
+        addOperator(new StubOperator("\""));
+
+        addOperator(new StubOperator("b"));
+        addOperator(new StubOperator("B"));
+        addOperator(new StubOperator("b*"));
+        addOperator(new StubOperator("B*"));
+
+        addOperator(new StubOperator("BDC"));
+        addOperator(new StubOperator("BMC"));
+        addOperator(new StubOperator("DP"));
+        addOperator(new StubOperator("EMC"));
+        addOperator(new StubOperator("BX"));
+        addOperator(new StubOperator("EX"));
+
+        addOperator(new StubOperator("d0"));
+        addOperator(new StubOperator("d1"));
+
+        addOperator(new StubOperator("f"));
+        addOperator(new StubOperator("F"));
+        addOperator(new StubOperator("f*"));
+
+        addOperator(new StubOperator("g"));
+        addOperator(new StubOperator("G"));
+
+        addOperator(new StubOperator("M"));
+        addOperator(new StubOperator("MP"));
+
+        addOperator(new StubOperator("gs"));
+        addOperator(new StubOperator("h"));
+        addOperator(new StubOperator("i"));
+
+        addOperator(new StubOperator("ri"));
+        addOperator(new StubOperator("s"));
+        addOperator(new StubOperator("S"));
+        addOperator(new StubOperator("sh"));
     }
 
     /**
@@ -233,7 +222,7 @@ public abstract class PreflightStreamEng
      */
     protected void validRenderingIntent(Operator operator, List arguments) throws ContentStreamException
     {
-        if ("ri".equals(operator.getOperation()))
+        if ("ri".equals(operator.getName()))
         {
             String riArgument0 = "";
             if (arguments.get(0) instanceof COSName)
@@ -261,7 +250,7 @@ public abstract class PreflightStreamEng
      */
     protected void validNumberOfGraphicStates(Operator operator) throws ContentStreamException
     {
-        if ("q".equals(operator.getOperation()))
+        if ("q".equals(operator.getName()))
         {
             int numberOfGraphicStates = this.getGraphicsStackSize();
             if (numberOfGraphicStates > MAX_GRAPHIC_STATES)
@@ -511,7 +500,7 @@ public abstract class PreflightStreamEng
      */
     protected void checkSetColorSpaceOperators(Operator operator, List<?> arguments) throws IOException
     {
-        if (!("CS".equals(operator.getOperation()) || "cs".equals(operator.getOperation())))
+        if (!("CS".equals(operator.getName()) || "cs".equals(operator.getName())))
         {
             return;
         }

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/StubOperator.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/StubOperator.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/StubOperator.java (original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/StubOperator.java Thu Sep 18 20:14:17 2014
@@ -45,7 +45,6 @@ import org.apache.pdfbox.cos.COSInteger;
 import org.apache.pdfbox.cos.COSName;
 import org.apache.pdfbox.cos.COSString;
 import org.apache.pdfbox.util.operator.Operator;
-import org.apache.pdfbox.util.operator.Operator;
 import org.apache.pdfbox.util.operator.OperatorProcessor;
 
 /**
@@ -54,6 +53,12 @@ import org.apache.pdfbox.util.operator.O
  */
 public class StubOperator extends OperatorProcessor
 {
+    private String name;
+
+    public StubOperator(String name)
+    {
+        this.name = name;
+    }
 
     /*
      * (non-Javadoc)
@@ -64,7 +69,7 @@ public class StubOperator extends Operat
     @Override
     public void process(Operator operator, List<COSBase> arguments) throws IOException
     {
-        String op = operator.getOperation();
+        String op = operator.getName();
         if ("S".equals(op))
         {
             checkNoOperands(arguments);
@@ -421,4 +426,10 @@ public class StubOperator extends Operat
         ex.setErrorCode(errorCode);
         return ex;
     }
+
+    @Override
+    public String getName()
+    {
+        return name;
+    }
 }

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/util/PreflightType3Stream.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/util/PreflightType3Stream.java?rev=1626070&r1=1626069&r2=1626070&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/util/PreflightType3Stream.java (original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/util/PreflightType3Stream.java Thu Sep 18 20:14:17 2014
@@ -36,7 +36,6 @@ import org.apache.pdfbox.pdmodel.graphic
 import org.apache.pdfbox.preflight.PreflightContext;
 import org.apache.pdfbox.preflight.content.PreflightStreamEngine;
 import org.apache.pdfbox.util.operator.Operator;
-import org.apache.pdfbox.util.operator.Operator;
 
 /**
  * This class is used to parse a glyph of a Type3 font program. If the glyph is parsed without error, the width of the
@@ -86,7 +85,7 @@ public class PreflightType3Stream extend
     protected void processOperator(Operator operator, List arguments) throws IOException
     {
         super.processOperator(operator, arguments);
-        String operation = operator.getOperation();
+        String operation = operator.getName();
 
         if (operation.equals("BI"))
         {



Mime
View raw message