/**
         * Loads all the supported graphics and text state operators in a map.
         */
        private void PopulateOperators()
        {
            RegisterContentOperator(DEFAULTOPERATOR, new IgnoreOperatorContentOperator());

            RegisterContentOperator("q", new PushGraphicsState());
            RegisterContentOperator("Q", new PopGraphicsState());
            RegisterContentOperator("cm", new ModifyCurrentTransformationMatrix());
            RegisterContentOperator("gs", new ProcessGraphicsStateResource());

            SetTextCharacterSpacing tcOperator = new SetTextCharacterSpacing();

            RegisterContentOperator("Tc", tcOperator);
            SetTextWordSpacing twOperator = new SetTextWordSpacing();

            RegisterContentOperator("Tw", twOperator);
            RegisterContentOperator("Tz", new SetTextHorizontalScaling());
            SetTextLeading tlOperator = new SetTextLeading();

            RegisterContentOperator("TL", tlOperator);
            RegisterContentOperator("Tf", new SetTextFont());
            RegisterContentOperator("Tr", new SetTextRenderMode());
            RegisterContentOperator("Ts", new SetTextRise());

            RegisterContentOperator("BT", new BeginTextC());
            RegisterContentOperator("ET", new EndTextC());
            RegisterContentOperator("BMC", new BeginMarkedContentC());
            RegisterContentOperator("BDC", new BeginMarkedContentDictionary());
            RegisterContentOperator("EMC", new EndMarkedContentC());

            TextMoveStartNextLine tdOperator = new TextMoveStartNextLine();

            RegisterContentOperator("Td", tdOperator);
            RegisterContentOperator("TD", new TextMoveStartNextLineWithLeading(tdOperator, tlOperator));
            RegisterContentOperator("Tm", new TextSetTextMatrix());
            TextMoveNextLine tstarOperator = new TextMoveNextLine(tdOperator);

            RegisterContentOperator("T*", tstarOperator);

            ShowText tjOperator = new ShowText();

            RegisterContentOperator("Tj", new ShowText());
            MoveNextLineAndShowText tickOperator = new MoveNextLineAndShowText(tstarOperator, tjOperator);

            RegisterContentOperator("'", tickOperator);
            RegisterContentOperator("\"", new MoveNextLineAndShowTextWithSpacing(twOperator, tcOperator, tickOperator));
            RegisterContentOperator("TJ", new ShowTextArray());

            RegisterContentOperator("Do", new Do());
        }
 public MoveNextLineAndShowTextWithSpacing(SetTextWordSpacing setTextWordSpacing, SetTextCharacterSpacing setTextCharacterSpacing, MoveNextLineAndShowText moveNextLineAndShowText)
 {
     this.setTextWordSpacing      = setTextWordSpacing;
     this.setTextCharacterSpacing = setTextCharacterSpacing;
     this.moveNextLineAndShowText = moveNextLineAndShowText;
 }
        /**
         * Loads all the supported graphics and text state operators in a map.
         */
        private void PopulateOperators(){

            RegisterContentOperator(DEFAULTOPERATOR, new IgnoreOperatorContentOperator());
            
            RegisterContentOperator("q", new PushGraphicsState());
            RegisterContentOperator("Q", new PopGraphicsState());
            RegisterContentOperator("g", new SetGrayFill());
            RegisterContentOperator("G", new SetGrayStroke());
            RegisterContentOperator("rg", new SetRGBFill());
            RegisterContentOperator("RG", new SetRGBStroke());
            RegisterContentOperator("k", new SetCMYKFill());
            RegisterContentOperator("K", new SetCMYKStroke());
            RegisterContentOperator("cs", new SetColorSpaceFill());
            RegisterContentOperator("CS", new SetColorSpaceStroke());
            RegisterContentOperator("sc", new SetColorFill());
            RegisterContentOperator("SC", new SetColorStroke());
            RegisterContentOperator("scn", new SetColorFill());
            RegisterContentOperator("SCN", new SetColorStroke());
            RegisterContentOperator("cm", new ModifyCurrentTransformationMatrix());
            RegisterContentOperator("gs", new ProcessGraphicsStateResource());

            SetTextCharacterSpacing tcOperator = new SetTextCharacterSpacing();
            RegisterContentOperator("Tc", tcOperator);
            SetTextWordSpacing twOperator = new SetTextWordSpacing();
            RegisterContentOperator("Tw", twOperator);
            RegisterContentOperator("Tz", new SetTextHorizontalScaling());
            SetTextLeading tlOperator = new SetTextLeading();
            RegisterContentOperator("TL", tlOperator);
            RegisterContentOperator("Tf", new SetTextFont());
            RegisterContentOperator("Tr", new SetTextRenderMode());
            RegisterContentOperator("Ts", new SetTextRise());

            RegisterContentOperator("BT", new BeginTextC());
            RegisterContentOperator("ET", new EndTextC());
            RegisterContentOperator("BMC", new BeginMarkedContentC());
            RegisterContentOperator("BDC", new BeginMarkedContentDictionary());
            RegisterContentOperator("EMC", new EndMarkedContentC());

            TextMoveStartNextLine tdOperator = new TextMoveStartNextLine();
            RegisterContentOperator("Td", tdOperator);
            RegisterContentOperator("TD", new TextMoveStartNextLineWithLeading(tdOperator, tlOperator));
            RegisterContentOperator("Tm", new TextSetTextMatrix());
            TextMoveNextLine tstarOperator = new TextMoveNextLine(tdOperator);
            RegisterContentOperator("T*", tstarOperator);

            ShowText tjOperator = new ShowText();
            RegisterContentOperator("Tj", tjOperator);
            MoveNextLineAndShowText tickOperator = new MoveNextLineAndShowText(tstarOperator, tjOperator);
            RegisterContentOperator("'", tickOperator);
            RegisterContentOperator("\"", new MoveNextLineAndShowTextWithSpacing(twOperator, tcOperator, tickOperator));
            RegisterContentOperator("TJ", new ShowTextArray());

            RegisterContentOperator("Do", new Do());
        }
 public MoveNextLineAndShowTextWithSpacing(SetTextWordSpacing setTextWordSpacing, SetTextCharacterSpacing setTextCharacterSpacing, MoveNextLineAndShowText moveNextLineAndShowText) {
     this.setTextWordSpacing = setTextWordSpacing;
     this.setTextCharacterSpacing = setTextCharacterSpacing;
     this.moveNextLineAndShowText = moveNextLineAndShowText;
 }
        /**
         * Loads all the supported graphics and text state operators in a map.
         */
        private void PopulateOperators(){

            RegisterContentOperator(DEFAULTOPERATOR, new IgnoreOperatorContentOperator());
            
            RegisterContentOperator("q", new PushGraphicsState());
            RegisterContentOperator("Q", new PopGraphicsState());
            RegisterContentOperator("g", new SetGrayFill());
            RegisterContentOperator("G", new SetGrayStroke());
            RegisterContentOperator("rg", new SetRGBFill());
            RegisterContentOperator("RG", new SetRGBStroke());
            RegisterContentOperator("k", new SetCMYKFill());
            RegisterContentOperator("K", new SetCMYKStroke());
            RegisterContentOperator("cs", new SetColorSpaceFill());
            RegisterContentOperator("CS", new SetColorSpaceStroke());
            RegisterContentOperator("sc", new SetColorFill());
            RegisterContentOperator("SC", new SetColorStroke());
            RegisterContentOperator("scn", new SetColorFill());
            RegisterContentOperator("SCN", new SetColorStroke());
            RegisterContentOperator("cm", new ModifyCurrentTransformationMatrix());
            RegisterContentOperator("gs", new ProcessGraphicsStateResource());

            SetTextCharacterSpacing tcOperator = new SetTextCharacterSpacing();
            RegisterContentOperator("Tc", tcOperator);
            SetTextWordSpacing twOperator = new SetTextWordSpacing();
            RegisterContentOperator("Tw", twOperator);
            RegisterContentOperator("Tz", new SetTextHorizontalScaling());
            SetTextLeading tlOperator = new SetTextLeading();
            RegisterContentOperator("TL", tlOperator);
            RegisterContentOperator("Tf", new SetTextFont());
            RegisterContentOperator("Tr", new SetTextRenderMode());
            RegisterContentOperator("Ts", new SetTextRise());

            RegisterContentOperator("BT", new BeginTextC());
            RegisterContentOperator("ET", new EndTextC());
            RegisterContentOperator("BMC", new BeginMarkedContentC());
            RegisterContentOperator("BDC", new BeginMarkedContentDictionary());
            RegisterContentOperator("EMC", new EndMarkedContentC());

            TextMoveStartNextLine tdOperator = new TextMoveStartNextLine();
            RegisterContentOperator("Td", tdOperator);
            RegisterContentOperator("TD", new TextMoveStartNextLineWithLeading(tdOperator, tlOperator));
            RegisterContentOperator("Tm", new TextSetTextMatrix());
            TextMoveNextLine tstarOperator = new TextMoveNextLine(tdOperator);
            RegisterContentOperator("T*", tstarOperator);

            ShowText tjOperator = new ShowText();
            RegisterContentOperator("Tj", tjOperator);
            MoveNextLineAndShowText tickOperator = new MoveNextLineAndShowText(tstarOperator, tjOperator);
            RegisterContentOperator("'", tickOperator);
            RegisterContentOperator("\"", new MoveNextLineAndShowTextWithSpacing(twOperator, tcOperator, tickOperator));
            RegisterContentOperator("TJ", new ShowTextArray());

            RegisterContentOperator("Do", new Do());

            RegisterContentOperator("w", new SetLineWidth());
            RegisterContentOperator("J", new SetLineCap());
            RegisterContentOperator("j", new SetLineJoin());
            RegisterContentOperator("M", new SetMiterLimit());
            RegisterContentOperator("d", new SetLineDashPattern());

            // Path construction and painting operators
            if (renderListener is IExtRenderListener) {
                int fillStroke = PathPaintingRenderInfo.FILL | PathPaintingRenderInfo.STROKE;
                RegisterContentOperator("m", new MoveTo());
                RegisterContentOperator("l", new LineTo());
                RegisterContentOperator("c", new Curve());
                RegisterContentOperator("v", new CurveFirstPointDuplicated());
                RegisterContentOperator("y", new CurveFourhPointDuplicated());
                RegisterContentOperator("h", new CloseSubpath());
                RegisterContentOperator("re", new Rectangle());
                RegisterContentOperator("S", new PaintPathOp(PathPaintingRenderInfo.STROKE, -1, false));
                RegisterContentOperator("s", new PaintPathOp(PathPaintingRenderInfo.STROKE, -1, true));
                RegisterContentOperator("f", new PaintPathOp(PathPaintingRenderInfo.FILL, PathPaintingRenderInfo.NONZERO_WINDING_RULE, false));
                RegisterContentOperator("F", new PaintPathOp(PathPaintingRenderInfo.FILL, PathPaintingRenderInfo.NONZERO_WINDING_RULE, false));
                RegisterContentOperator("f*", new PaintPathOp(PathPaintingRenderInfo.FILL, PathPaintingRenderInfo.EVEN_ODD_RULE, false));
                RegisterContentOperator("B", new PaintPathOp(fillStroke, PathPaintingRenderInfo.NONZERO_WINDING_RULE, false));
                RegisterContentOperator("B*", new PaintPathOp(fillStroke, PathPaintingRenderInfo.EVEN_ODD_RULE, false));
                RegisterContentOperator("b", new PaintPathOp(fillStroke, PathPaintingRenderInfo.NONZERO_WINDING_RULE, true));
                RegisterContentOperator("b*", new PaintPathOp(fillStroke, PathPaintingRenderInfo.EVEN_ODD_RULE, true));
                RegisterContentOperator("n", new PaintPathOp(PathPaintingRenderInfo.NO_OP, -1, false));
                RegisterContentOperator("W", new ClipPathOp(PathPaintingRenderInfo.NONZERO_WINDING_RULE));
                RegisterContentOperator("W*", new ClipPathOp(PathPaintingRenderInfo.EVEN_ODD_RULE));
            }
        }