Package org.pdfclown.documents.contents.colorSpaces

Examples of org.pdfclown.documents.contents.colorSpaces.DeviceRGBColor


      pageSize.getHeight()
      );

    // Step 0.
    {
      colors[0] = new DeviceRGBColor(30f/255, 10f/255, 0);
      composer.setFillColor(colors[0]);
      composer.setStrokeColor(colors[0]);

      // Draw the page frame!
      composer.drawRectangle(frame);
      composer.stroke();

      // Draw the lower-left corner mark!
      composer.showText(
        "Step 0",
        new Point2D.Double(0,pageSize.getHeight()),
        AlignmentXEnum.Left,
        AlignmentYEnum.Bottom,
        0
        );

      steps[0] = getStepNote(composer,"default");
    }

    // Step 1.
    {
      colors[1] = new DeviceRGBColor(80f/255, 25f/255, 0);
      composer.setFillColor(colors[1]);
      composer.setStrokeColor(colors[1]);

      // Transform the coordinate space, applying translation!
      composer.translate(72,72);

      // Draw the page frame!
      composer.drawRectangle(frame);
      composer.stroke();

      // Draw the lower-left corner mark!
      composer.showText(
        "Step 1",
        new Point2D.Double(0,pageSize.getHeight()),
        AlignmentXEnum.Left,
        AlignmentYEnum.Bottom,
        0
        );

      steps[1] = getStepNote(composer,"after translate(72,72)");
    }

    // Step 2.
    {
      colors[2] = new DeviceRGBColor(130f/255, 45f/255, 0);
      composer.setFillColor(colors[2]);
      composer.setStrokeColor(colors[2]);

      // Transform the coordinate space, applying clockwise rotation!
      composer.rotate(-20);

      // Draw the page frame!
      composer.drawRectangle(frame);
      composer.stroke();

      // Draw the coordinate space origin mark!
      composer.showText("Origin 2");

      // Draw the lower-left corner mark!
      composer.showText(
        "Step 2",
        new Point2D.Double(0,pageSize.getHeight()),
        AlignmentXEnum.Left,
        AlignmentYEnum.Bottom,
        0
        );

      steps[2] = getStepNote(composer,"after rotate(-20)");
    }

    // Step 3.
    {
      colors[3] = new DeviceRGBColor(180f/255, 60f/255, 0);
      composer.setFillColor(colors[3]);
      composer.setStrokeColor(colors[3]);

      // Transform the coordinate space, applying translation and scaling!
      composer.translate(0,72);
      composer.scale(.5f,.5f);

      // Draw the page frame!
      composer.drawRectangle(frame);
      composer.stroke();

      // Draw the lower-left corner mark!
      composer.showText(
        "Step 3",
        new Point2D.Double(0,pageSize.getHeight()),
        AlignmentXEnum.Left,
        AlignmentYEnum.Bottom,
        0
        );

      steps[3] = getStepNote(composer,"after translate(0,72) and scale(.5,.5)");
    }

    // Step 4.
    {
      colors[4] = new DeviceRGBColor(230f/255, 75f/255, 0);
      composer.setFillColor(colors[4]);
      composer.setStrokeColor(colors[4]);

      // Transform the coordinate space, restoring its initial CTM!
      composer.add(
View Full Code Here


    Line line = new Line(
      page,
      new Point(50, 260),
      new Point(200,210)
      );
    line.setFillColor(new DeviceRGBColor(1,0,0));
    line.setStartStyle(Line.LineEndStyleEnum.Circle);
    line.setEndStyle(Line.LineEndStyleEnum.ClosedArrow);
    line.setText("Arrow line annotation");
    line.setCaptionVisible(true);

    // Dimension line.
    composer.showText("Dimension:", new Point(300,200));
    line = new Line(
      page,
      new Point(300,220),
      new Point(500,220)
      );
    line.setLeaderLineLength(20);
    line.setLeaderLineExtensionLength(10);
    line.setText("Dimension line annotation");
    line.setCaptionVisible(true);
   
    composer.end();

    // Scribble.
    composer.showText("Scribble annotation:", new Point(35,285));
    Scribble scribble = new Scribble(
      page,
      new Rectangle(50, 300, 100, 30),
      Arrays.asList(
        Arrays.asList(
          (Point2D)new Point(50,300),
          (Point2D)new Point(70,310),
          (Point2D)new Point(100,320)
          )
        )
      );
    scribble.setText("Scribble annotation");

    // Rectangle.
    composer.showText("Rectangle annotation:", new Point(35,335));
    org.pdfclown.documents.interaction.annotations.Rectangle rectangle = new org.pdfclown.documents.interaction.annotations.Rectangle(
      page,
      new Rectangle(50, 350, 100, 30)
      );
    rectangle.setFillColor(new DeviceRGBColor(1,0,0));
    rectangle.setText("Rectangle annotation");

    // Ellipse.
    composer.showText("Ellipse annotation:", new Point(35,385));
    Ellipse ellipse = new Ellipse(
      page,
      new Rectangle(50, 400, 100, 30)
      );
    ellipse.setFillColor(new DeviceRGBColor(0,0,1));
    ellipse.setText("Ellipse annotation");

    // Rubber stamp.
    composer.showText("Rubber stamp annotation:", new Point(35,435));
    RubberStamp rubberStamp = new RubberStamp(
View Full Code Here

      try
      {
        composer.beginLocalState();
        composer.setFont(font,10);
        composer.setFillColor(new DeviceRGBColor(0,0,1));
        composer.showText(
          "PDF Clown Project's repository at SourceForge.net",
          new Point2D.Double(240,265),
          AlignmentXEnum.Left,
          AlignmentYEnum.Middle,
View Full Code Here

      composer.drawRectangle(arcFrame);
      composer.stroke();
      composer.end();

      // Drawing the circle...
      composer.setFillColor(new DeviceRGBColor(1,0,0));
      composer.drawEllipse(arcFrame);
      composer.fillStroke();
    }

    // 3.3. Horizontal ellipse.
    {
      Rectangle2D arcFrame = new Rectangle2D.Double(
        210,
        300,
        100,
        50
        );

      // Drawing the ellipse frame...
      composer.beginLocalState();
      composer.setLineWidth(.25f);
      composer.setLineDash(3,5,5);
      composer.drawRectangle(arcFrame);
      composer.stroke();
      composer.end();

      // Drawing the ellipse...
      composer.setFillColor(new DeviceRGBColor(0,1,0));
      composer.drawEllipse(arcFrame);
      composer.fillStroke();
    }

    // 3.4. Vertical ellipse.
    {
      Rectangle2D arcFrame = new Rectangle2D.Double(
        320,
        300,
        50,
        100
        );

      // Drawing the ellipse frame...
      composer.beginLocalState();
      composer.setLineWidth(.25f);
      composer.setLineDash(3,5,5);
      composer.drawRectangle(arcFrame);
      composer.stroke();
      composer.end();

      // Drawing the ellipse...
      composer.setFillColor(new DeviceRGBColor(0,0,1));
      composer.drawEllipse(arcFrame);
      composer.fillStroke();
    }

    // 3.5. Spirals.
View Full Code Here

      if(x > 300)
      {
        composer.setLineDash(3,5,5);
      }

      composer.setFillColor(new DeviceRGBColor(1,x/500,x/500));
      composer.drawRectangle(
          new Rectangle2D.Double(x,250,150,100),
          radius // NOTE: radius parameter determines the rounded angle size.
          );
      composer.fillStroke();
View Full Code Here

    */
    PdfArray fillColorObject = (PdfArray)getBaseDataObject().get(PdfName.IC);
    if(fillColorObject == null)
      return null;
//TODO:use baseObject constructor!!!
    return new DeviceRGBColor(
      ((PdfNumber<?>)fillColorObject.get(0)).getNumberValue(),
      ((PdfNumber<?>)fillColorObject.get(1)).getNumberValue(),
      ((PdfNumber<?>)fillColorObject.get(2)).getNumberValue()
      );
  }
View Full Code Here

TOP

Related Classes of org.pdfclown.documents.contents.colorSpaces.DeviceRGBColor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.