pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jahew...@apache.org
Subject svn commit: r1610021 [1/3] - in /pdfbox/trunk: examples/src/main/java/org/apache/pdfbox/examples/util/ pdfbox/src/main/java/org/apache/pdfbox/pdfparser/ pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/ p...
Date Sat, 12 Jul 2014 18:35:49 GMT
Author: jahewson
Date: Sat Jul 12 18:35:46 2014
New Revision: 1610021

URL: http://svn.apache.org/r1610021
Log:
PDFBOX-2205: (Graphics) Operator Refactoring

Added:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/optionalcontent/
      - copied from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/optional_content/
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/PDFGraphicsStreamEngine.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/DrawObject.java
      - copied, changed from r1609347, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/Invoke.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/Operator.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/PDFOperator.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetColor.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetColor.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetNonStrokingColor.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetNonStrokingColor.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetNonStrokingColorSpace.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetNonStrokingColorSpace.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetNonStrokingDeviceCMYKColor.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetNonStrokingDeviceCMYKColor.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetNonStrokingDeviceGrayColor.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetNonStrokingDeviceGrayColor.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetNonStrokingDeviceRGBColor.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetNonStrokingDeviceRGBColor.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetStrokingColor.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetStrokingColor.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetStrokingColorSpace.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetStrokingColorSpace.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetStrokingDeviceCMYKColor.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetStrokingDeviceCMYKColor.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetStrokingDeviceGrayColor.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetStrokingDeviceGrayColor.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetStrokingDeviceRGBColor.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetStrokingDeviceRGBColor.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/
      - copied from r1609347, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/pagedrawer/
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/CloseAndStrokePath.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/CloseAndStrokePath.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/DrawObject.java
      - copied, changed from r1609347, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/pagedrawer/Invoke.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/GraphicsOperatorProcessor.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/ShadingFill.java
      - copied, changed from r1609347, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/pagedrawer/SHFill.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/markedcontent/
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/markedcontent/BeginMarkedContentSequence.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/BeginMarkedContentSequence.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/markedcontent/BeginMarkedContentSequenceWithProperties.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/BeginMarkedContentSequenceWithProperties.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/markedcontent/EndMarkedContentSequence.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/EndMarkedContentSequence.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/Concatenate.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/Concatenate.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/Restore.java
      - copied, changed from r1609347, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/GRestore.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/Save.java
      - copied, changed from r1609347, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/GSave.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetGraphicsStateParameters.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetGraphicsStateParameters.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineCapStyle.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetLineCapStyle.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineDashPattern.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetLineDashPattern.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineJoinStyle.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetLineJoinStyle.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineMiterLimit.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetLineMiterLimit.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetLineWidth.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetLineWidth.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/state/SetMatrix.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetMatrix.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/BeginText.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/BeginText.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/EndText.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/EndText.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/MoveAndShow.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/MoveAndShow.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/MoveText.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/MoveText.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/MoveTextSetLeading.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/MoveTextSetLeading.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/NextLine.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/NextLine.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetCharSpacing.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetCharSpacing.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetHorizontalTextScaling.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetHorizontalTextScaling.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetMoveAndShow.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetMoveAndShow.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetTextFont.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetTextFont.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetTextLeading.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetTextLeading.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetTextRenderingMode.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetTextRenderingMode.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetTextRise.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetTextRise.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/SetWordSpacing.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetWordSpacing.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/ShowText.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/ShowText.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/text/ShowTextGlyph.java
      - copied, changed from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/ShowTextGlyph.java
    pdfbox/trunk/pdfbox/src/main/resources/org/apache/pdfbox/resources/PDFGraphicsStreamEngine.properties
      - copied, changed from r1609347, pdfbox/trunk/pdfbox/src/main/resources/org/apache/pdfbox/resources/PageDrawer.properties
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/graphics/optionalcontent/
      - copied from r1609836, pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/graphics/optional_content/
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/rendering/
Removed:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/optional_content/
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/BeginMarkedContentSequence.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/BeginMarkedContentSequenceWithProperties.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/BeginText.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/CloseAndStrokePath.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/Concatenate.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/EndMarkedContentSequence.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/EndText.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/GRestore.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/GSave.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/Invoke.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/MoveAndShow.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/MoveText.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/MoveTextSetLeading.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/NextLine.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/PDFOperator.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetCharSpacing.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetColor.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetGraphicsStateParameters.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetHorizontalTextScaling.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetLineCapStyle.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetLineDashPattern.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetLineJoinStyle.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetLineMiterLimit.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetLineWidth.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetMatrix.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetMoveAndShow.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetNonStrokingColor.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetNonStrokingColorSpace.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetNonStrokingDeviceCMYKColor.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetNonStrokingDeviceGrayColor.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetNonStrokingDeviceRGBColor.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetStrokingColor.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetStrokingColorSpace.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetStrokingDeviceCMYKColor.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetStrokingDeviceGrayColor.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetStrokingDeviceRGBColor.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetTextFont.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetTextLeading.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetTextRenderingMode.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetTextRise.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetWordSpacing.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/ShowText.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/ShowTextGlyph.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/Invoke.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/SHFill.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/pagedrawer/
    pdfbox/trunk/pdfbox/src/main/resources/org/apache/pdfbox/resources/PageDrawer.properties
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/graphics/optional_content/
Modified:
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/PrintImageLocations.java
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/RemoveAllText.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/ContentStreamWriter.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPropertyList.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDColor.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDPattern.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/optionalcontent/PDOptionalContentGroup.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/optionalcontent/PDOptionalContentProperties.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDAppearanceString.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/LayerUtility.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/PDFStreamEngine.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/OperatorProcessor.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/AppendRectangleToPath.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/BeginInlineImage.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/ClipEvenOddRule.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/ClipNonZeroRule.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/CloseFillEvenOddAndStrokePath.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/CloseFillNonZeroAndStrokePath.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/ClosePath.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/CurveTo.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/CurveToReplicateFinalPoint.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/CurveToReplicateInitialPoint.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/EndPath.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/FillEvenOddAndStrokePath.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/FillEvenOddRule.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/FillNonZeroAndStrokePath.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/FillNonZeroRule.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/LineTo.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/MoveTo.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/StrokePath.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/graphics/package.html
    pdfbox/trunk/pdfbox/src/main/resources/org/apache/pdfbox/resources/PDFMarkedContentExtractor.properties
    pdfbox/trunk/pdfbox/src/main/resources/org/apache/pdfbox/resources/PDFTextStripper.properties
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/TestAll.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/edit/TestPDPageContentStream.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/graphics/optionalcontent/TestOptionalContentGroups.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/TestLayerUtility.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightContentStream.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightStreamEngine.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/content/StubOperator.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/util/PreflightType3Stream.java

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/PrintImageLocations.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/PrintImageLocations.java?rev=1610021&r1=1610020&r2=1610021&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/PrintImageLocations.java (original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/PrintImageLocations.java Sat Jul 12 18:35:46 2014
@@ -27,7 +27,8 @@ import org.apache.pdfbox.pdmodel.graphic
 import org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject;
 import org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject;
 import org.apache.pdfbox.util.Matrix;
-import org.apache.pdfbox.util.operator.PDFOperator;
+import org.apache.pdfbox.util.operator.Operator;
+import org.apache.pdfbox.util.operator.Operator;
 import org.apache.pdfbox.util.PDFStreamEngine;
 import org.apache.pdfbox.util.ResourceLoader;
 
@@ -121,7 +122,7 @@ public class PrintImageLocations extends
      *
      * @throws IOException If there is an error processing the operation.
      */
-    protected void processOperator( PDFOperator operator, List arguments ) throws IOException
+    protected void processOperator( Operator operator, List arguments ) throws IOException
     {
         String operation = operator.getOperation();
         if( INVOKE_OPERATOR.equals(operation) )

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/RemoveAllText.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/RemoveAllText.java?rev=1610021&r1=1610020&r2=1610021&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/RemoveAllText.java (original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/RemoveAllText.java Sat Jul 12 18:35:46 2014
@@ -22,7 +22,8 @@ import org.apache.pdfbox.pdfwriter.Conte
 import org.apache.pdfbox.pdmodel.PDDocument;
 import org.apache.pdfbox.pdmodel.PDPage;
 import org.apache.pdfbox.pdmodel.common.PDStream;
-import org.apache.pdfbox.util.operator.PDFOperator;
+import org.apache.pdfbox.util.operator.Operator;
+import org.apache.pdfbox.util.operator.Operator;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -80,9 +81,9 @@ public class RemoveAllText
                     for( int j=0; j<tokens.size(); j++)
                     {
                         Object token = tokens.get( j );
-                        if( token instanceof PDFOperator )
+                        if( token instanceof Operator)
                         {
-                            PDFOperator op = (PDFOperator)token;
+                            Operator op = (Operator)token;
                             if( op.getOperation().equals( "TJ") || op.getOperation().equals( "Tj" ))
                             {
                                 //remove the one argument to this operator

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java?rev=1610021&r1=1610020&r2=1610021&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java Sat Jul 12 18:35:46 2014
@@ -35,7 +35,8 @@ import org.apache.pdfbox.cos.COSObject;
 import org.apache.pdfbox.cos.COSStream;
 import org.apache.pdfbox.io.RandomAccess;
 import org.apache.pdfbox.pdmodel.common.PDStream;
-import org.apache.pdfbox.util.operator.PDFOperator;
+import org.apache.pdfbox.util.operator.Operator;
+import org.apache.pdfbox.util.operator.Operator;
 
 /**
  * This will parse a PDF byte stream and extract operands and such.
@@ -286,7 +287,7 @@ public class PDFStreamParser extends Bas
                 }
                 else
                 {
-                    retval = PDFOperator.getOperator( nullString );
+                    retval = Operator.getOperator(nullString);
                 }
                 break;
             }
@@ -305,7 +306,7 @@ public class PDFStreamParser extends Bas
                 }
                 else
                 {
-                    retval = PDFOperator.getOperator( next );
+                    retval = Operator.getOperator(next);
                 }
                 break;
             }
@@ -318,7 +319,7 @@ public class PDFStreamParser extends Bas
                 }
                 else
                 {
-                    retval = PDFOperator.getOperator( line );
+                    retval = Operator.getOperator(line);
                 }
                 break;
             }
@@ -359,10 +360,10 @@ public class PDFStreamParser extends Bas
             case 'B':
             {
                 String next = readString();
-                retval = PDFOperator.getOperator( next );
+                retval = Operator.getOperator(next);
                 if( next.equals( "BI" ) )
                 {
-                    PDFOperator beginImageOP = (PDFOperator)retval;
+                    Operator beginImageOP = (Operator)retval;
                     COSDictionary imageParams = new COSDictionary();
                     beginImageOP.setImageParameters( imageParams );
                     Object nextToken = null;
@@ -372,7 +373,7 @@ public class PDFStreamParser extends Bas
                         imageParams.setItem( (COSName)nextToken, (COSBase)value );
                     }
                     //final token will be the image data, maybe??
-                    PDFOperator imageData = (PDFOperator)nextToken;
+                    Operator imageData = (Operator)nextToken;
                     beginImageOP.setImageData( imageData.getImageData() );
                 }
                 break;
@@ -409,9 +410,9 @@ public class PDFStreamParser extends Bas
                     currentByte = pdfSource.read();
                 }
                 // the EI operator isn't unread, as it won't be processed anyway
-                retval = PDFOperator.getOperator( "ID" );
+                retval = Operator.getOperator("ID");
                 // save the image data to the operator, so that it can be accessed later
-                ((PDFOperator)retval).setImageData( imageData.toByteArray() );
+                ((Operator)retval).setImageData( imageData.toByteArray() );
                 break;
             }
             case ']':
@@ -433,7 +434,7 @@ public class PDFStreamParser extends Bas
                 }
                 else
                 {
-                    retval = PDFOperator.getOperator( operator );
+                    retval = Operator.getOperator(operator);
                 }
             }
         }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/ContentStreamWriter.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/ContentStreamWriter.java?rev=1610021&r1=1610020&r2=1610021&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/ContentStreamWriter.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/ContentStreamWriter.java Sat Jul 12 18:35:46 2014
@@ -31,7 +31,8 @@ import org.apache.pdfbox.cos.COSInteger;
 import org.apache.pdfbox.cos.COSName;
 import org.apache.pdfbox.cos.COSString;
 
-import org.apache.pdfbox.util.operator.PDFOperator;
+import org.apache.pdfbox.util.operator.Operator;
+import org.apache.pdfbox.util.operator.Operator;
 
 /**
  * A class that will take a list of tokens and write out a stream with them.
@@ -133,9 +134,9 @@ public class ContentStreamWriter
             output.write( COSWriter.DICT_CLOSE );
             output.write( SPACE );
         }
-        else if( o instanceof PDFOperator )
+        else if( o instanceof Operator)
         {
-            PDFOperator op = (PDFOperator)o;
+            Operator op = (Operator)o;
             if( op.getOperation().equals( "BI" ) )
             {
                 output.write( "BI".getBytes("ISO-8859-1") );

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java?rev=1610021&r1=1610020&r2=1610021&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java Sat Jul 12 18:35:46 2014
@@ -33,7 +33,7 @@ import org.apache.pdfbox.pdmodel.common.
 import org.apache.pdfbox.pdmodel.documentinterchange.logicalstructure.PDMarkInfo;
 import org.apache.pdfbox.pdmodel.documentinterchange.logicalstructure.PDStructureTreeRoot;
 import org.apache.pdfbox.pdmodel.graphics.color.PDOutputIntent;
-import org.apache.pdfbox.pdmodel.graphics.optional_content.PDOptionalContentProperties;
+import org.apache.pdfbox.pdmodel.graphics.optionalcontent.PDOptionalContentProperties;
 import org.apache.pdfbox.pdmodel.interactive.action.PDActionFactory;
 import org.apache.pdfbox.pdmodel.interactive.action.PDDocumentCatalogAdditionalActions;
 import org.apache.pdfbox.pdmodel.interactive.action.PDURIDictionary;

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPropertyList.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPropertyList.java?rev=1610021&r1=1610020&r2=1610021&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPropertyList.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPropertyList.java Sat Jul 12 18:35:46 2014
@@ -20,7 +20,7 @@ import org.apache.pdfbox.cos.COSBase;
 import org.apache.pdfbox.cos.COSDictionary;
 import org.apache.pdfbox.cos.COSName;
 import org.apache.pdfbox.pdmodel.common.COSObjectable;
-import org.apache.pdfbox.pdmodel.graphics.optional_content.PDOptionalContentGroup;
+import org.apache.pdfbox.pdmodel.graphics.optionalcontent.PDOptionalContentGroup;
 
 /**
  * This class represents a property list used for the marked content feature to map a resource name

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDColor.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDColor.java?rev=1610021&r1=1610020&r2=1610021&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDColor.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDColor.java Sat Jul 12 18:35:46 2014
@@ -21,6 +21,7 @@ import org.apache.pdfbox.cos.COSName;
 import org.apache.pdfbox.cos.COSNumber;
 import org.apache.pdfbox.cos.COSString;
 
+import java.io.IOException;
 import java.util.Arrays;
 
 /**
@@ -123,6 +124,32 @@ public final class PDColor
     }
 
     /**
+     * Returns true if this color value is a pattern.
+     * @return true if this color value is a pattern
+     */
+    public boolean isPattern()
+    {
+        return patternName != null;
+    }
+
+    // todo: toRGB() which returns a packed int
+    // todo: getColorSpace() getter
+
+    // STARTING POINT:
+    // todo: JavaDoc [TODO: WHAT TO DO IF THIS IS A PATTERN? THROW ERROR?]
+    public int toRGB(PDColorSpace colorSpace) throws IOException // todo: store colorSpace locally (Also, fallback color if exception?)
+    {
+        float[] floats = colorSpace.toRGB(components);
+        int r = Math.round(floats[0] * 255);
+        int g = Math.round(floats[1] * 255);
+        int b = Math.round(floats[2] * 255);
+        int rgb = r;
+        rgb = (rgb << 8) + g;
+        rgb = (rgb << 8) + b;
+        return rgb;
+    }
+
+    /**
      * Returns this color value as a COS array
      * @return the color value as a COS array
      */

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDPattern.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDPattern.java?rev=1610021&r1=1610020&r2=1610021&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDPattern.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDPattern.java Sat Jul 12 18:35:46 2014
@@ -16,8 +16,6 @@
  */
 package org.apache.pdfbox.pdmodel.graphics.color;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.pdfbox.cos.COSName;
 import org.apache.pdfbox.pdmodel.graphics.pattern.PDAbstractPattern;
 import org.apache.pdfbox.pdmodel.graphics.pattern.PDShadingPattern;
@@ -40,8 +38,6 @@ import java.util.Map;
  */
 public final class PDPattern extends PDSpecialColorSpace
 {
-    private static final Log LOG = LogFactory.getLog(PDPattern.class);
-
     private Map<String, PDAbstractPattern> patterns;
     private PDColorSpace underlyingColorSpace;
 
@@ -107,12 +103,7 @@ public final class PDPattern extends PDS
     @Override
     public Paint toPaint(PDFRenderer renderer, PDColor color, int pageHeight) throws IOException
     {
-        if (!patterns.containsKey(color.getPatternName()))
-        {
-            throw new IOException("pattern " + color.getPatternName() + " was not found");
-        }
-
-        PDAbstractPattern pattern = patterns.get(color.getPatternName());
+        PDAbstractPattern pattern = getPattern(color);
         if (pattern instanceof PDTilingPattern)
         {
             PDTilingPattern tilingPattern = (PDTilingPattern)pattern;
@@ -135,6 +126,20 @@ public final class PDPattern extends PDS
         }
     }
 
+    /**
+     * Returns the pattern for the given color.
+     * @param color color containing a pattern name
+     * @return pattern for the given color
+     */
+    public final PDAbstractPattern getPattern(PDColor color) throws IOException
+    {
+      if (!patterns.containsKey(color.getPatternName()))
+      {
+        throw new IOException("pattern " + color.getPatternName() + " was not found");
+      }
+      return patterns.get(color.getPatternName());
+    }
+
     @Override
     public String toString()
     {

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/optionalcontent/PDOptionalContentGroup.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/optionalcontent/PDOptionalContentGroup.java?rev=1610021&r1=1609836&r2=1610021&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/optionalcontent/PDOptionalContentGroup.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/optionalcontent/PDOptionalContentGroup.java Sat Jul 12 18:35:46 2014
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.pdfbox.pdmodel.graphics.optional_content;
+package org.apache.pdfbox.pdmodel.graphics.optionalcontent;
 
 import org.apache.pdfbox.cos.COSBase;
 import org.apache.pdfbox.cos.COSDictionary;

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/optionalcontent/PDOptionalContentProperties.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/optionalcontent/PDOptionalContentProperties.java?rev=1610021&r1=1609836&r2=1610021&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/optionalcontent/PDOptionalContentProperties.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/optionalcontent/PDOptionalContentProperties.java Sat Jul 12 18:35:46 2014
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.pdfbox.pdmodel.graphics.optional_content;
+package org.apache.pdfbox.pdmodel.graphics.optionalcontent;
 
 import java.util.Collection;
 

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDAppearanceString.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDAppearanceString.java?rev=1610021&r1=1610020&r2=1610021&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDAppearanceString.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDAppearanceString.java Sat Jul 12 18:35:46 2014
@@ -51,7 +51,8 @@ import org.apache.pdfbox.pdmodel.interac
 import org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceStream;
 import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationWidget;
 
-import org.apache.pdfbox.util.operator.PDFOperator;
+import org.apache.pdfbox.util.operator.Operator;
+import org.apache.pdfbox.util.operator.Operator;
 
 /**
  * A default appearance string contains any graphics state or text state operators needed to
@@ -191,7 +192,7 @@ public final class PDAppearanceString
      */
     private boolean containsMarkedContent( List stream )
     {
-        return stream.contains( PDFOperator.getOperator( "BMC" ) );
+        return stream.contains( Operator.getOperator("BMC") );
     }
 
     /**
@@ -276,8 +277,8 @@ public final class PDAppearanceString
                     {
                         if( daTokens != null )
                         {
-                            int bmcIndex = tokens.indexOf( PDFOperator.getOperator( "BMC" ));
-                            int emcIndex = tokens.indexOf( PDFOperator.getOperator( "EMC" ));
+                            int bmcIndex = tokens.indexOf( Operator.getOperator("BMC"));
+                            int emcIndex = tokens.indexOf( Operator.getOperator("EMC"));
                             if( bmcIndex != -1 && emcIndex != -1 &&
                                 emcIndex == bmcIndex+1 )
                             {
@@ -300,7 +301,7 @@ public final class PDAppearanceString
                                 drawnString.append( apValue.getBytes("ISO-8859-1") );
                             }
                         }
-                        int setFontIndex = tokens.indexOf( PDFOperator.getOperator( "Tf" ));
+                        int setFontIndex = tokens.indexOf( Operator.getOperator("Tf"));
                         tokens.set( setFontIndex-1, new COSFloat( fontSize ) );
                         if( foundString )
                         {
@@ -308,8 +309,8 @@ public final class PDAppearanceString
                         }
                         else
                         {
-                            int bmcIndex = tokens.indexOf( PDFOperator.getOperator( "BMC" ) );
-                            int emcIndex = tokens.indexOf( PDFOperator.getOperator( "EMC" ) );
+                            int bmcIndex = tokens.indexOf( Operator.getOperator("BMC") );
+                            int emcIndex = tokens.indexOf( Operator.getOperator("EMC") );
 
                             if( bmcIndex != -1 )
                             {
@@ -356,7 +357,7 @@ public final class PDAppearanceString
             daParser.parse();
             List<Object> daTokens = daParser.getTokens();
             fontSize = calculateFontSize( pdFont, boundingBox, tokens, daTokens );
-            int fontIndex = daTokens.indexOf( PDFOperator.getOperator( "Tf" ) );
+            int fontIndex = daTokens.indexOf( Operator.getOperator("Tf") );
             if(fontIndex != -1 )
             {
                 daTokens.set( fontIndex-1, new COSFloat( fontSize ) );
@@ -430,7 +431,7 @@ public final class PDAppearanceString
                 tokens = streamParser.getTokens();
             }
 
-            int setFontIndex = tokens.indexOf( PDFOperator.getOperator( "Tf" ));
+            int setFontIndex = tokens.indexOf( Operator.getOperator("Tf"));
             COSName cosFontName = (COSName)tokens.get( setFontIndex-2 );
             String fontName = cosFontName.getName();
             retval = (PDFont)streamResources.getFonts().get( fontName );
@@ -471,8 +472,8 @@ public final class PDAppearanceString
         float retval = 1;
         if( tokens != null )
         {
-            int btIndex = tokens.indexOf(PDFOperator.getOperator( "BT" ));
-            int wIndex = tokens.indexOf(PDFOperator.getOperator( "w" ));
+            int btIndex = tokens.indexOf(Operator.getOperator("BT"));
+            int wIndex = tokens.indexOf(Operator.getOperator("w"));
             //the w should only be used if it is before the first BT.
             if( (wIndex > 0) && (wIndex < btIndex) )
             {
@@ -488,7 +489,7 @@ public final class PDAppearanceString
         for( int i=0; i<tokens.size(); i++ )
         {
             Object next = tokens.get( i );
-            if( next == PDFOperator.getOperator( "re" ) )
+            if( next == Operator.getOperator("re") )
             {
                 COSNumber x = (COSNumber)tokens.get( i-4 );
                 COSNumber y = (COSNumber)tokens.get( i-3 );
@@ -526,7 +527,7 @@ public final class PDAppearanceString
         {
             //daString looks like   "BMC /Helv 3.4 Tf EMC"
 
-            int fontIndex = daTokens.indexOf( PDFOperator.getOperator( "Tf" ) );
+            int fontIndex = daTokens.indexOf( Operator.getOperator("Tf") );
             if(fontIndex != -1 )
             {
                 fontSize = ((COSNumber)daTokens.get(fontIndex-1)).floatValue();

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java?rev=1610021&r1=1610020&r2=1610021&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java Sat Jul 12 18:35:46 2014
@@ -22,7 +22,6 @@ import java.awt.Composite;
 import java.awt.Font;
 import java.awt.Graphics;
 import java.awt.Graphics2D;
-import java.awt.Image;
 import java.awt.Paint;
 import java.awt.RenderingHints;
 import java.awt.Shape;
@@ -40,7 +39,6 @@ import java.awt.image.Raster;
 import java.awt.image.WritableRaster;
 import java.io.IOException;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 import org.apache.commons.logging.Log;
@@ -50,6 +48,7 @@ import org.apache.fontbox.ttf.TrueTypeFo
 import org.apache.fontbox.type1.Type1Font;
 import org.apache.pdfbox.cos.COSName;
 import org.apache.pdfbox.cos.COSStream;
+import org.apache.pdfbox.pdmodel.graphics.image.PDImage;
 import org.apache.pdfbox.rendering.font.Glyph2D;
 import org.apache.pdfbox.rendering.font.TTFGlyph2D;
 import org.apache.pdfbox.rendering.font.Type1Glyph2D;
@@ -83,15 +82,14 @@ import org.apache.pdfbox.pdmodel.interac
 import org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceDictionary;
 import org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceStream;
 import org.apache.pdfbox.util.Matrix;
-import org.apache.pdfbox.util.PDFStreamEngine;
-import org.apache.pdfbox.util.ResourceLoader;
+import org.apache.pdfbox.util.PDFGraphicsStreamEngine;
 
 /**
  * Paints a page in a PDF document to a Graphics context.
  * 
  * @author Ben Litchfield
  */
-public class PageDrawer extends PDFStreamEngine
+public class PageDrawer extends PDFGraphicsStreamEngine
 {
     private static final Log LOG = LogFactory.getLog(PageDrawer.class);
     private static final Color COLOR_TRANSPARENT = new Color(0, 0, 0, 0);
@@ -99,7 +97,6 @@ public class PageDrawer extends PDFStrea
     // parent document renderer
     private final PDFRenderer renderer;
 
-    private final PDPage page; // will be null if this is a TilingPatternDrawer
     private Graphics2D graphics;
 
     // clipping winding rule used for the clipping path
@@ -112,7 +109,7 @@ public class PageDrawer extends PDFStrea
     private final Map<PDFont, Glyph2D> fontGlyph2D = new HashMap<PDFont, Glyph2D>();
     private final Map<PDFont, Font> awtFonts = new HashMap<PDFont, Font>();
 
-    private int pageHeight;
+    private PDRectangle pageSize;
     
     /**
      * Default constructor, loads properties from file.
@@ -121,9 +118,8 @@ public class PageDrawer extends PDFStrea
      */
     public PageDrawer(PDFRenderer renderer, PDPage page) throws IOException
     {
-        super(ResourceLoader.loadProperties("org/apache/pdfbox/resources/PageDrawer.properties", true));
+        super(page);
         this.renderer = renderer;
-        this.page = page;
     }
 
     /**
@@ -133,9 +129,8 @@ public class PageDrawer extends PDFStrea
      */
     PageDrawer(PDFRenderer renderer) throws IOException
     {
-        super(ResourceLoader.loadProperties("org/apache/pdfbox/resources/PageDrawer.properties", true));
+        super(null);
         this.renderer = renderer;
-        this.page = null;
     }
 
     /**
@@ -148,15 +143,6 @@ public class PageDrawer extends PDFStrea
     }
 
     /**
-     * Returns the page height.
-     * @return the page height
-     */
-    public int getPageHeight()
-    {
-        return pageHeight;
-    }
-
-    /**
      * This will draw the page to the requested context.
      * 
      * @param g The graphics context to draw onto.
@@ -167,16 +153,17 @@ public class PageDrawer extends PDFStrea
     public void drawPage(Graphics g, PDRectangle pageSize) throws IOException
     {
         graphics = (Graphics2D) g;
-        pageHeight = (int)pageSize.getHeight();
+        this.pageSize = pageSize;
         graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
         graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
-        graphics.translate(0, pageHeight);
+        graphics.translate(0, pageSize.getHeight());
         graphics.scale(1, -1);
         // TODO use getStroke() to set the initial stroke
         graphics.setStroke(new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER));
 
         // Only if there is some content, we have to process it.
         // Otherwise we are done here and we will produce an empty page
+        PDPage page = getPage();
         if (page.getContents() != null)
         {
             PDResources resources = page.findResources();
@@ -197,7 +184,7 @@ public class PageDrawer extends PDFStrea
                 Map<String, PDAppearanceStream> appearanceMap = appearDictionary.getNormalAppearance();
                 if (appearanceMap != null)
                 {
-                    PDAppearanceStream appearance = (PDAppearanceStream) appearanceMap.get(appearanceName);
+                    PDAppearanceStream appearance = appearanceMap.get(appearanceName);
                     if (appearance != null)
                     {
                         Point2D point = new Point2D.Float(rect.getLowerLeftX(), rect.getLowerLeftY());
@@ -232,6 +219,7 @@ public class PageDrawer extends PDFStrea
                                   Matrix matrix, PDColorSpace colorSpace, PDColor color)
                                   throws IOException
     {
+        pageSize = pageDimension;
         graphics = g;
         graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
         graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
@@ -605,12 +593,28 @@ public class PageDrawer extends PDFStrea
 
     /**
      * Get the current line path to be drawn.
-     * 
+     *
      * @return The current line path to be drawn.
      */
-    public GeneralPath getLinePath()
+    // TODO: NO LONGER PUBLIC :)
+    /*public GeneralPath getLinePath()
     {
         return linePath;
+    }*/
+
+    @Override // todo: is this "append or draw?"
+    public void appendRectangle(Point2D p0, Point2D p1, Point2D p2, Point2D p3)
+    {
+        // to ensure that the path is created in the right direction, we have to create
+        // it by combining single lines instead of creating a simple rectangle
+        linePath.moveTo((float) p0.getX(), (float) p0.getY());
+        linePath.lineTo((float) p1.getX(), (float) p1.getY());
+        linePath.lineTo((float) p2.getX(), (float) p2.getY());
+        linePath.lineTo((float) p3.getX(), (float) p3.getY());
+
+        // close the subpath instead of adding the last line so that a possible set line
+        // cap style isn't taken into account at the "beginning" of the rectangle
+        linePath.closePath();
     }
 
     /**
@@ -622,15 +626,15 @@ public class PageDrawer extends PDFStrea
      */
     private Raster createSoftMaskRaster(PDSoftMask softMask) throws IOException
     {
-        TransparencyGroup result = createTransparencyGroup(softMask.getGroup());
-        COSName sMaskSubType = softMask.getSubType();
-        if (COSName.ALPHA.equals(sMaskSubType))
+        TransparencyGroup transparencyGroup = createTransparencyGroup(softMask.getGroup());
+        COSName subtype = softMask.getSubType();
+        if (COSName.ALPHA.equals(subtype))
         {
-            return result.getAlphaRaster();
+            return transparencyGroup.getAlphaRaster();
         }
-        else if (COSName.LUMINOSITY.equals(sMaskSubType))
+        else if (COSName.LUMINOSITY.equals(subtype))
         {
-            return result.getLuminosityRaster();
+            return transparencyGroup.getLuminosityRaster();
         }
         else
         {
@@ -655,14 +659,15 @@ public class PageDrawer extends PDFStrea
     {
         PDGraphicsState graphicsState = getGraphicsState();
         return applySoftMaskToPaint(graphicsState.getStrokingColorSpace()
-                .toPaint(renderer, graphicsState.getStrokingColor(), pageHeight), graphicsState.getSoftMask());
+                .toPaint(renderer, graphicsState.getStrokingColor(), (int)pageSize.getHeight()),
+                         graphicsState.getSoftMask());
     }
 
     // returns the non-stroking AWT Paint
     private Paint getNonStrokingPaint() throws IOException
     {
         return getGraphicsState().getNonStrokingColorSpace()
-                .toPaint(renderer, getGraphicsState().getNonStrokingColor(), pageHeight);
+                .toPaint(renderer, getGraphicsState().getNonStrokingColor(), (int)pageSize.getHeight());
     }
 
     // create a new stroke based on the current CTM and the current stroke
@@ -701,11 +706,7 @@ public class PageDrawer extends PDFStrea
                                state.getMiterLimit(), dashArray, phaseStart);
     }
 
-    /**
-     * Stroke the path.
-     * 
-     * @throws IOException If there is an IO error while stroking the path.
-     */
+    @Override
     public void strokePath() throws IOException
     {
         graphics.setComposite(getGraphicsState().getStrokeJavaComposite());
@@ -724,13 +725,7 @@ public class PageDrawer extends PDFStrea
         linePath.reset();
     }
 
-    /**
-     * Fill the path.
-     *
-     * @param windingRule The winding rule this path will use.
-     *
-     * @throws IOException If there is an IO error while filling the path.
-     */
+    @Override
     public void fillPath(int windingRule) throws IOException
     {
         graphics.setComposite(getGraphicsState().getNonStrokeJavaComposite());
@@ -756,6 +751,7 @@ public class PageDrawer extends PDFStrea
      *
      * @throws IOException If there is an IO error while filling the path.
      */
+    @Override
     public void fillAndStrokePath(int windingRule) throws IOException
     {
         // TODO can we avoid cloning the path?
@@ -765,20 +761,44 @@ public class PageDrawer extends PDFStrea
         strokePath();
     }
 
-    /**
-     * Modify the current clipping path by intersecting it with the current path.
-     * The clipping path will not be updated until the succeeding painting operator is called.
-     * 
-     * @param windingRule The winding rule which will be used for clipping.
-     */
+    @Override
     public void clip(int windingRule)
     {
+        // the clipping path will not be updated until the succeeding painting operator is called
         clipWindingRule = windingRule;
     }
 
-    /**
-     * Ends the current path without filling or stroking it. The clipping path is updated here.
-     */
+    @Override
+    public void moveTo(float x, float y)
+    {
+        linePath.moveTo(x, y);
+    }
+
+    @Override
+    public void lineTo(float x, float y)
+    {
+        linePath.lineTo(x, y);
+    }
+
+    @Override
+    public void curveTo(float x1, float y1, float x2, float y2, float x3, float y3)
+    {
+        linePath.curveTo(x1, y1, x2, y2, x3, y3);
+    }
+
+    @Override
+    public Point2D getCurrentPoint()
+    {
+        return linePath.getCurrentPoint();
+    }
+
+    @Override
+    public void closePath()
+    {
+        linePath.closePath();
+    }
+
+    @Override
     public void endPath()
     {
         if (clipWindingRule != -1)
@@ -790,57 +810,66 @@ public class PageDrawer extends PDFStrea
         linePath.reset();
     }
 
-    /**
-     * Draw the AWT image. Called by Invoke. Moved into PageDrawer so that Invoke doesn't have to
-     * reach in here for Graphics as that breaks extensibility.
-     * 
-     * @param awtImage The image to draw.
-     * @param at The transformation to use when drawing.
-     * 
-     */
-    public void drawImage(Image awtImage, AffineTransform at) throws IOException
+    public void drawImage(PDImage pdImage) throws IOException
+    {
+        Matrix ctm = getGraphicsState().getCurrentTransformationMatrix();
+        AffineTransform at = ctm.createAffineTransform();
+
+        if (pdImage.isStencil())
+        {
+            // fill the image with paint
+            PDColorSpace colorSpace = getGraphicsState().getNonStrokingColorSpace();
+            PDColor color = getGraphicsState().getNonStrokingColor();
+            BufferedImage image = pdImage.getStencilImage(colorSpace.toPaint(renderer, color,
+                                                          (int)pageSize.getHeight()));
+
+            // draw the image
+            drawBufferedImage(image, at);
+        }
+        else
+        {
+            // draw the image
+            drawBufferedImage(pdImage.getImage(), at);
+        }
+    }
+
+    public void drawBufferedImage(BufferedImage image, AffineTransform at) throws IOException
     {
         graphics.setComposite(getGraphicsState().getNonStrokeJavaComposite());
         setClip();
         PDSoftMask softMask = getGraphicsState().getSoftMask();
-        if( softMask != null ) 
+        if( softMask != null )
         {
             AffineTransform imageTransform = new AffineTransform(at);
             imageTransform.scale(1, -1);
             imageTransform.translate(0, -1);
-            Paint awtPaint = new TexturePaint((BufferedImage)awtImage, 
+            Paint awtPaint = new TexturePaint(image,
                     new Rectangle2D.Double(imageTransform.getTranslateX(), imageTransform.getTranslateY(),
-                            imageTransform.getScaleX(), imageTransform.getScaleY())); 
+                            imageTransform.getScaleX(), imageTransform.getScaleY()));
             awtPaint = applySoftMaskToPaint(awtPaint, softMask);
             graphics.setPaint(awtPaint);
             graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
-                                      RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
+                    RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
             Rectangle2D unitRect = new Rectangle2D.Float(0, 0, 1, 1);
             graphics.fill(at.createTransformedShape(unitRect));
         }
-        else 
+        else
         {
-            int width = awtImage.getWidth(null);
-            int height = awtImage.getHeight(null);
+            int width = image.getWidth(null);
+            int height = image.getHeight(null);
             AffineTransform imageTransform = new AffineTransform(at);
             imageTransform.scale(1.0 / width, -1.0 / height);
             imageTransform.translate(0, -height);
-            graphics.drawImage(awtImage, imageTransform, null);
+            graphics.drawImage(image, imageTransform, null);
         }
     }
 
-    /**
-     * Fill with Shading. Called by SHFill operator.
-     *
-     * @param shadingName The name of the Shading Dictionary to use for this fill instruction.
-     *
-     * @throws IOException If there is an IO error while shade-filling the clipping area.
-     */
-    public void shFill(COSName shadingName) throws IOException
+    @Override
+    public void shadingFill(COSName shadingName) throws IOException
     {
         PDShading shading = getResources().getShadings().get(shadingName.getName());
         Matrix ctm = getGraphicsState().getCurrentTransformationMatrix();
-        Paint paint = shading.toPaint(ctm, pageHeight);
+        Paint paint = shading.toPaint(ctm, (int)pageSize.getHeight());
 
         graphics.setComposite(getGraphicsState().getNonStrokeJavaComposite());
         graphics.setPaint(paint);
@@ -850,16 +879,14 @@ public class PageDrawer extends PDFStrea
         graphics.fill(getGraphicsState().getCurrentClippingPath());
     }
 
+    @Override
+    public void showTransparencyGroup(PDFormXObject form) throws IOException
+    {
+        TransparencyGroup group = createTransparencyGroup(form);
+        group.draw();
+    }
 
-    /**
-     * Draws the transparency group into a {@link BufferedImage} object and returns it together
-     * with the transformation matrix.
-     *
-     * @param form {@link PageDrawer} object
-     * @return PageDrawer.Group
-     * @throws IOException
-     */
-    public TransparencyGroup createTransparencyGroup(PDFormXObject form) throws IOException
+    private TransparencyGroup createTransparencyGroup(PDFormXObject form) throws IOException
     {
         saveGraphicsState();
         try
@@ -891,7 +918,7 @@ public class PageDrawer extends PDFStrea
     /**
      * Transparency group.
      **/
-    public final class TransparencyGroup
+    private final class TransparencyGroup
     {
         private final BufferedImage image;
         private final Matrix matrix;
@@ -908,7 +935,8 @@ public class PageDrawer extends PDFStrea
          * @param resources Global resources
          * @param content Content of the transparency group to create
          */
-        private TransparencyGroup(GeneralPath clippingPath, PDResources resources, COSStream content) throws IOException
+        private TransparencyGroup(GeneralPath clippingPath, PDResources resources,
+                                  COSStream content) throws IOException
         {
             Graphics2D g2dOriginal = graphics;
             Area lastClipOriginal = lastClip;
@@ -989,7 +1017,7 @@ public class PageDrawer extends PDFStrea
             if (matrix != null)
             {
                 saveGraphicsState();
-                drawImage(image, matrix.createAffineTransform());
+                drawBufferedImage(image, matrix.createAffineTransform());
                 restoreGraphicsState();
             }
         }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/LayerUtility.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/LayerUtility.java?rev=1610021&r1=1610020&r2=1610021&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/LayerUtility.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/LayerUtility.java Sat Jul 12 18:35:46 2014
@@ -37,8 +37,8 @@ import org.apache.pdfbox.pdmodel.common.
 import org.apache.pdfbox.pdmodel.common.PDStream;
 import org.apache.pdfbox.pdmodel.edit.PDPageContentStream;
 import org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject;
-import org.apache.pdfbox.pdmodel.graphics.optional_content.PDOptionalContentGroup;
-import org.apache.pdfbox.pdmodel.graphics.optional_content.PDOptionalContentProperties;
+import org.apache.pdfbox.pdmodel.graphics.optionalcontent.PDOptionalContentGroup;
+import org.apache.pdfbox.pdmodel.graphics.optionalcontent.PDOptionalContentProperties;
 import org.apache.pdfbox.pdmodel.PDPropertyList;
 
 /**

Added: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/PDFGraphicsStreamEngine.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/PDFGraphicsStreamEngine.java?rev=1610021&view=auto
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/PDFGraphicsStreamEngine.java (added)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/PDFGraphicsStreamEngine.java Sat Jul 12 18:35:46 2014
@@ -0,0 +1,138 @@
+/*
+ * 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;
+
+import org.apache.pdfbox.cos.COSName;
+import org.apache.pdfbox.pdmodel.PDPage;
+import org.apache.pdfbox.pdmodel.graphics.image.PDImage;
+
+import java.awt.geom.Point2D;
+import java.io.IOException;
+
+/**
+ * PDFStreamEngine subclass for advanced processing of graphics.
+ * This class should be subclasses by end users looking to hook into graphics operations.
+ *
+ * @author John Hewson
+ */
+public abstract class PDFGraphicsStreamEngine extends PDFStreamEngine
+{
+    // may be null, for example if the stream is a tiling pattern
+    private final PDPage page;
+
+    /**
+     * Default constructor, loads properties from file.
+     *
+     * @throws java.io.IOException If there is an error loading properties from the file.
+     */
+    protected PDFGraphicsStreamEngine(PDPage page) throws IOException
+    {
+        super(ResourceLoader
+                .loadProperties("org/apache/pdfbox/resources/PDFGraphicsStreamEngine.properties",
+                                true));
+        this.page = page;
+    }
+
+    /**
+     * Returns the page.
+     */
+    protected final PDPage getPage()
+    {
+        return page;
+    }
+
+    /**
+     * Append a rectangle to the current path.
+     */
+    public abstract void appendRectangle(Point2D p0, Point2D p1,
+                                         Point2D p2, Point2D p3) throws IOException;
+
+    /**
+     * Draw the image.
+     *
+     * @param pdImage The image to draw.
+     */
+    public abstract void drawImage(PDImage pdImage) throws IOException;
+
+    /**
+     * Modify the current clipping path by intersecting it with the current path.
+     * The clipping path will not be updated until the succeeding painting operator is called.
+     *
+     * @param windingRule The winding rule which will be used for clipping.
+     */
+    public abstract void clip(int windingRule) throws IOException;
+
+    /**
+     * Starts a new path at (x,y).
+     */
+    public abstract void moveTo(float x, float y) throws IOException;
+
+    /**
+     * Draws a line from the current point to (x,y).
+     */
+    public abstract void lineTo(float x, float y) throws IOException;
+
+    /**
+     * Draws a curve from the current point to (x3,y3) using (x1,y1) and (x2,y2) as control points.
+     */
+    public abstract void curveTo(float x1, float y1,
+                                 float x2, float y2,
+                                 float x3, float y3) throws IOException;
+
+    /**
+     * Returns the current point of the current path.
+     */
+    public abstract Point2D getCurrentPoint() throws IOException;
+
+    /**
+     * Closes the current path.
+     */
+    public abstract void closePath() throws IOException;
+
+    /**
+     * Ends the current path without filling or stroking it. The clipping path is updated here.
+     */
+    public abstract void endPath() throws IOException;
+
+    /**
+     * Stroke the path.
+     *
+     * @throws IOException If there is an IO error while stroking the path.
+     */
+    public abstract void strokePath() throws IOException;
+
+    /**
+     * Fill the path.
+     *
+     * @param windingRule The winding rule this path will use.
+     */
+    public abstract void fillPath(int windingRule) throws IOException;
+
+    /**
+     * Fills and then strokes the path.
+     *
+     * @param windingRule The winding rule this path will use.
+     */
+    public abstract void fillAndStrokePath(int windingRule) throws IOException;
+
+    /**
+     * Fill with Shading.
+     *
+     * @param shadingName The name of the Shading Dictionary to use for this fill instruction.
+     */
+    public abstract void shadingFill(COSName shadingName) throws IOException;
+}

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/PDFStreamEngine.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/PDFStreamEngine.java?rev=1610021&r1=1610020&r2=1610021&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/PDFStreamEngine.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/PDFStreamEngine.java Sat Jul 12 18:35:46 2014
@@ -42,11 +42,12 @@ import org.apache.pdfbox.pdmodel.common.
 import org.apache.pdfbox.pdmodel.common.PDRectangle;
 import org.apache.pdfbox.pdmodel.font.PDFont;
 import org.apache.pdfbox.pdmodel.font.PDType3Font;
+import org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject;
 import org.apache.pdfbox.pdmodel.graphics.state.PDExtendedGraphicsState;
 import org.apache.pdfbox.pdmodel.graphics.state.PDGraphicsState;
 import org.apache.pdfbox.pdmodel.graphics.PDXObject;
+import org.apache.pdfbox.util.operator.Operator;
 import org.apache.pdfbox.util.operator.OperatorProcessor;
-import org.apache.pdfbox.util.operator.PDFOperator;
 
 /**
  * Processes a PDF content stream and executes certain operations.
@@ -175,10 +176,10 @@ public class PDFStreamEngine
     /**
      * This will initialise and process the contents of the stream.
      * 
-     * @param resources The location to retrieve resources.
-     * @param cosStream the Stream to execute.
+     * @param resources the location to retrieve resources
+     * @param cosStream the Stream to execute
      * @param drawingSize the size of the page
-     * @throws IOException if there is an error accessing the stream.
+     * @throws IOException if there is an error accessing the stream
      */
     public void processStream(PDResources resources, COSStream cosStream, PDRectangle drawingSize)
             throws IOException
@@ -188,11 +189,33 @@ public class PDFStreamEngine
     }
 
     /**
+     * Shows a form from the content stream.
+     *
+     * @param form form XObject
+     * @throws IOException if the form cannot be processed
+     */
+    public void showForm(PDFormXObject form) throws IOException
+    {
+        processSubStream(form.getResources(), form.getCOSStream());
+    }
+
+    /**
+     * Shows a transparency group from the content stream.
+     *
+     * @param form transparency group (form) XObject
+     * @throws IOException if the transparency group cannot be processed
+     */
+    public void showTransparencyGroup(PDFormXObject form) throws IOException
+    {
+        showForm(form);
+    }
+
+    /**
      * Process a sub stream of the current stream.
      * 
-     * @param resources The resources used when processing the stream.
-     * @param cosStream The stream to process.
-     * @throws IOException If there is an exception while processing the stream.
+     * @param resources the resources used when processing the stream
+     * @param cosStream the stream to process
+     * @throws IOException if there is an exception while processing the stream
      */
     public void processSubStream(PDResources resources, COSStream cosStream) throws IOException
     {
@@ -239,9 +262,9 @@ public class PDFStreamEngine
                 {
                     arguments.add(((COSObject) next).getObject());
                 }
-                else if (next instanceof PDFOperator)
+                else if (next instanceof Operator)
                 {
-                    processOperator((PDFOperator) next, arguments);
+                    processOperator((Operator) next, arguments);
                     arguments = new ArrayList<COSBase>();
                 }
                 else
@@ -268,13 +291,70 @@ public class PDFStreamEngine
     }
 
     /**
+     * Called when the ET operator is encountered. This method is for overriding in subclasses, the
+     * default implementation does nothing.
+     *
+     * @throws IOException if there was an error processing the text
+     */
+    public void endText() throws IOException
+    {
+        // overridden in subclasses
+    }
+
+    /**
+     * Called when a string of text is to be shown.
+     *
+     * @param string the encoded text
+     * @throws IOException if there was an error showing the text
+     */
+    public void showText(byte[] string) throws IOException
+    {
+        processText(string);
+    }
+
+    /**
+     * Called when a string of text with spacing adjustments is to be shown.
+     *
+     * @param strings list of the encoded text
+     * @param adjustments spacing adjustment for each string
+     * @throws IOException if there was an error showing the text
+     */
+    public void showAdjustedText(List<byte[]> strings, List<Float> adjustments) throws IOException
+    {
+        float fontsize = getGraphicsState().getTextState().getFontSize();
+        float horizontalScaling = getGraphicsState().getTextState().getHorizontalScaling() / 100;
+        for (int i = 0, len = strings.size(); i < len; i++)
+        {
+            float adjustment = adjustments.get(i);
+            Matrix adjMatrix = new Matrix();
+            adjustment =- (adjustment / 1000) * horizontalScaling * fontsize;
+            // TODO vertical writing mode
+            adjMatrix.setValue( 2, 0, adjustment );
+            showAdjustedTextRun(strings.get(i), adjMatrix);
+        }
+    }
+
+    /**
+     * Called when a single run of text with a spacing adjustment is to be shown.
+     *
+     * @param string the encoded text
+     * @param adjustment spacing adjustment to apply before showing the string
+     * @throws IOException if there was an error showing the text
+     */
+    protected void showAdjustedTextRun(byte[] string, Matrix adjustment) throws IOException
+    {
+        setTextMatrix(adjustment.multiply(getTextMatrix(), adjustment));
+        processText(string);
+    }
+
+    /**
      * Process text from the PDF Stream. You should override this method if you want to
      * perform an action when encoded text is being processed.
      * 
-     * @param string The encoded text
-     * @throws IOException If there is an error processing the string
+     * @param string the encoded text
+     * @throws IOException if there is an error processing the string
      */
-    public void processText(byte[] string) throws IOException
+    protected void processText(byte[] string) throws IOException
     {
         // Note on variable names. There are three different units being used in this code.
         // Character sizes are given in glyph units, text locations are initially given in text
@@ -452,7 +532,7 @@ public class PDFStreamEngine
     {
         try
         {
-            PDFOperator operator = PDFOperator.getOperator(operation);
+            Operator operator = Operator.getOperator(operation);
             processOperator(operator, arguments);
         }
         catch (IOException e)
@@ -468,7 +548,7 @@ public class PDFStreamEngine
      * @param arguments The list of arguments.
      * @throws IOException If there is an error processing the operation.
      */
-    protected void processOperator(PDFOperator operator, List<COSBase> arguments) throws IOException
+    protected void processOperator(Operator operator, List<COSBase> arguments) throws IOException
     {
         String operation = operator.getOperation();
         OperatorProcessor processor = operators.get(operation);

Copied: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/DrawObject.java (from r1609347, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/Invoke.java)
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/DrawObject.java?p2=pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/DrawObject.java&p1=pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/Invoke.java&r1=1609347&r2=1610021&rev=1610021&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/Invoke.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/DrawObject.java Sat Jul 12 18:35:46 2014
@@ -18,8 +18,6 @@ package org.apache.pdfbox.util.operator;
 
 import org.apache.pdfbox.cos.COSBase;
 import org.apache.pdfbox.cos.COSName;
-import org.apache.pdfbox.cos.COSStream;
-import org.apache.pdfbox.pdmodel.PDResources;
 import org.apache.pdfbox.pdmodel.graphics.PDXObject;
 import org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject;
 import org.apache.pdfbox.util.Matrix;
@@ -30,23 +28,15 @@ import java.util.List;
 import java.util.Map;
 
 /**
- * Invoke named XObject.
+ * Do: Draws an XObject.
  *
- * @author <a href="mailto:ben@benlitchfield.com">Ben Litchfield</a>
+ * @author Ben Litchfield
  * @author Mario Ivankovits
- *
- * @version $Revision: 1.9 $
  */
-public class Invoke extends OperatorProcessor
+public class DrawObject extends OperatorProcessor
 {
-    /**
-     * Do: Invoke the named XObject.
-     * 
-     * @param operator The operator that is being executed.
-     * @param arguments List
-     * @throws IOException If there is an error processing this operator.
-     */
-    public void process(PDFOperator operator, List<COSBase> arguments) throws IOException
+    @Override
+    public void process(Operator operator, List<COSBase> arguments) throws IOException
     {
         COSName name = (COSName) arguments.get(0);
 
@@ -60,7 +50,6 @@ public class Invoke extends OperatorProc
         if(xobject instanceof PDFormXObject)
         {
             PDFormXObject form = (PDFormXObject)xobject;
-            COSStream formContentstream = form.getCOSStream();
 
             // if there is an optional form matrix, we have to map the form space to the user space
             Matrix matrix = form.getMatrix();
@@ -70,9 +59,7 @@ public class Invoke extends OperatorProc
                 context.getGraphicsState().setCurrentTransformationMatrix(xobjectCTM);
             }
 
-            // find some optional resources, instead of using the current resources
-            PDResources pdResources = form.getResources();
-            context.processSubStream(pdResources, formContentstream);
+            context.showForm(form);
         }
     }
 }

Copied: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/Operator.java (from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/PDFOperator.java)
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/Operator.java?p2=pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/Operator.java&p1=pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/PDFOperator.java&r1=1609836&r2=1610021&rev=1610021&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/PDFOperator.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/Operator.java Sat Jul 12 18:35:46 2014
@@ -21,26 +21,25 @@ import org.apache.pdfbox.cos.COSDictiona
 import java.util.concurrent.ConcurrentHashMap;
 
 /**
- * This class represents an Operator in the content stream.
+ * An Operator in a PDF content stream.
  *
- * @author <a href="mailto:ben@benlitchfield.com">Ben Litchfield</a>
- * @version $Revision: 1.14 $
+ * @author Ben Litchfield
  */
-public class PDFOperator
+public class Operator
 {
     private String theOperator;
     private byte[] imageData;
     private COSDictionary imageParameters;
 
     /** map for singleton operator objects; use {@link ConcurrentHashMap} for better scalability with multiple threads */
-    private final static ConcurrentHashMap<String,PDFOperator> operators = new ConcurrentHashMap<String, PDFOperator>();
+    private final static ConcurrentHashMap<String,Operator> operators = new ConcurrentHashMap<String, Operator>();
 
     /**
      * Constructor.
      *
      * @param aOperator The operator that this object will represent.
      */
-    private PDFOperator( String aOperator )
+    private Operator(String aOperator)
     {
         theOperator = aOperator;
         if( aOperator.startsWith( "/" ) )
@@ -56,13 +55,13 @@ public class PDFOperator
      *
      * @return The operator that matches the operator keyword.
      */
-    public static PDFOperator getOperator( String operator )
+    public static Operator getOperator( String operator )
     {
-        PDFOperator operation = null;
+        Operator operation = null;
         if( operator.equals( "ID" ) || operator.equals( "BI" ) )
         {
             //we can't cache the ID operators.
-            operation = new PDFOperator( operator );
+            operation = new Operator( operator );
         }
         else
         {
@@ -71,7 +70,7 @@ public class PDFOperator
             {
                 // another thread may has already added an operator of this kind
                 // make sure that we get the same operator
-                operation = operators.putIfAbsent( operator, new PDFOperator( operator ) );
+                operation = operators.putIfAbsent( operator, new Operator( operator ) );
                 if ( operation == null )
                 {
                     operation = operators.get( operator );

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/OperatorProcessor.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/OperatorProcessor.java?rev=1610021&r1=1610020&r2=1610021&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/OperatorProcessor.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/OperatorProcessor.java Sat Jul 12 18:35:46 2014
@@ -23,12 +23,13 @@ import java.io.IOException;
 
 /**
  * Processes a PDF operator.
+ *
  * @author Laurent Huault
  */
 public abstract class OperatorProcessor
 {
     /** The processing context. */
-    protected PDFStreamEngine context = null;
+    protected PDFStreamEngine context;
 
     /**
      * Creates a new OperatorProcessor.
@@ -61,5 +62,5 @@ public abstract class OperatorProcessor
      * @param operands the operands to use when processing
      * @throws IOException if the operator cannot be processed
      */
-    public abstract void process(PDFOperator operator, List<COSBase> operands) throws IOException;
+    public abstract void process(Operator operator, List<COSBase> operands) throws IOException;
 }

Copied: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetColor.java (from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetColor.java)
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetColor.java?p2=pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetColor.java&p1=pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetColor.java&r1=1609836&r2=1610021&rev=1610021&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetColor.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetColor.java Sat Jul 12 18:35:46 2014
@@ -14,30 +14,27 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.pdfbox.util.operator;
+package org.apache.pdfbox.util.operator.color;
 
 import org.apache.pdfbox.cos.COSArray;
 import org.apache.pdfbox.cos.COSBase;
 import org.apache.pdfbox.pdmodel.graphics.color.PDColor;
 import org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace;
+import org.apache.pdfbox.util.operator.Operator;
+import org.apache.pdfbox.util.operator.OperatorProcessor;
 
 import java.io.IOException;
 import java.util.List;
 
 /**
- * Sets the color to use for stroking or non-stroking operations.
+ * sc,scn,SC,SCN: Sets the color to use for stroking or non-stroking operations.
  *
  * @author John Hewson
  */
 public abstract class SetColor extends OperatorProcessor
 {
-    /**
-     * sc,scn,SC,SCN Sets the colour to use for stroking or non-stroking operations.
-     * @param operator the operator that is being executed.
-     * @param arguments list of operands
-     * @throws IOException if the color space cannot be read
-     */
-    public void process(PDFOperator operator, List<COSBase> arguments) throws IOException
+    @Override
+    public void process(Operator operator, List<COSBase> arguments) throws IOException
     {
         COSArray array = new COSArray();
         array.addAll(arguments);

Copied: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetNonStrokingColor.java (from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetNonStrokingColor.java)
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetNonStrokingColor.java?p2=pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetNonStrokingColor.java&p1=pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetNonStrokingColor.java&r1=1609836&r2=1610021&rev=1610021&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetNonStrokingColor.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetNonStrokingColor.java Sat Jul 12 18:35:46 2014
@@ -14,13 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.pdfbox.util.operator;
+package org.apache.pdfbox.util.operator.color;
 
 import org.apache.pdfbox.pdmodel.graphics.color.PDColor;
 import org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace;
 
 /**
- * sc,scn Sets the colour to use for stroking non-stroking operations.
+ * sc,scn: Sets the colour to use for stroking non-stroking operations.
  *
  * @author John Hewson
  */

Copied: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetNonStrokingColorSpace.java (from r1609836, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetNonStrokingColorSpace.java)
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetNonStrokingColorSpace.java?p2=pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetNonStrokingColorSpace.java&p1=pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetNonStrokingColorSpace.java&r1=1609836&r2=1610021&rev=1610021&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/SetNonStrokingColorSpace.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/operator/color/SetNonStrokingColorSpace.java Sat Jul 12 18:35:46 2014
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.pdfbox.util.operator;
+package org.apache.pdfbox.util.operator.color;
 
 import java.io.IOException;
 import java.util.List;
@@ -22,22 +22,19 @@ import java.util.List;
 import org.apache.pdfbox.cos.COSBase;
 import org.apache.pdfbox.cos.COSName;
 import org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace;
+import org.apache.pdfbox.util.operator.Operator;
+import org.apache.pdfbox.util.operator.OperatorProcessor;
 
 /**
- * Sets the non-stroking color space.
+ * cs: Sets the non-stroking color space.
  *
  * @author Ben Litchfield
  * @author John Hewson
  */
 public class SetNonStrokingColorSpace extends OperatorProcessor
 {
-    /**
-     * cs Set color space for non-stroking operations.
-     * @param operator The operator that is being executed.
-     * @param arguments List
-     * @throws IOException If an error occurs while processing the font.
-     */
-    public void process(PDFOperator operator, List<COSBase> arguments) throws IOException
+    @Override
+    public void process(Operator operator, List<COSBase> arguments) throws IOException
     {
         COSName name = (COSName)arguments.get(0);
 



Mime
View raw message