Package org.pdfclown.documents.contents.colorSpaces

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


    {/* NOOP. */}
    if(image == null)
    {
      blockComposer.begin(frame,AlignmentXEnum.Left,AlignmentYEnum.Top);
      composer.setFont(bodyFont,12);
      composer.setFillColor(new DeviceRGBColor(1,0,0));
      blockComposer.showText("The file you uploaded wasn't a valid JPEG image!");
      blockComposer.end();

      // Move past the closed block!
      frame.y = blockComposer.getBoundBox().getMaxY() + 20;
View Full Code Here


      );

    // Showing the 'PDFClown' label inside the common content stream...
    composer.beginLocalState();
    composer.setFillColor(
      new DeviceRGBColor(115f/255,164f/255,232f/255)
      );
    // Set the font to use!
    composer.setFont(
      new StandardType1Font(
        document,
View Full Code Here

        12
        );
    }
    catch(Exception e)
    {}
    composer.setFillColor(new DeviceRGBColor(115f/255,164f/255,232f/255));
    blockComposer.showText("showText() methods return the actual bounding box of the shown text, allowing to precisely determine its location on the page.");
    blockComposer.end();

    composer.setStrokeColor(new DeviceRGBColor(115f/255,164f/255,232f/255));

    // 3. Inserting contents...
    // Set the font to use!
    try
    {
View Full Code Here

{
  // <dynamic>
  // <constructors>
  public DefaultStyle(
    )
  {setBackColor(new DeviceRGBColor(.9f,.9f,.9f));}
View Full Code Here

        ),
      120
      );
    // Set the color to fill the text characters!
    composer.setFillColor(
      new DeviceRGBColor(115f/255, 164f/255, 232f/255)
      );
    // Show the text!
    composer.showText(
      "PDFClown", // Text to show.
      new Point2D.Double(size.getWidth()/2d,size.getHeight()/2d), // Anchor location: page center.
View Full Code Here

          "PDF Clown Home Page",
          new GoToURI(document, new URI("http://www.pdfclown.org"))
          )
        );
      bookmark.setFlags(EnumSet.of(FlagsEnum.Bold, FlagsEnum.Italic));
      bookmark.setColor(new DeviceRGBColor(.5f,.5f,1f));
    }
    catch(URISyntaxException e)
    {/* NOOP */}

    buildAccessories(document,"Complex Typesetting","complex typesetting");
View Full Code Here

      );

    // Showing the 'PDFClown' label inside the common content stream...
    composer.beginLocalState();
    composer.setFillColor(
      new DeviceRGBColor(115f/255,164f/255,232f/255)
      );
    // Set the font to use!
    composer.setFont(
      new StandardType1Font(
        document,
        StandardType1Font.FamilyEnum.Times,
        true,
        false
        ),
      120
      );
    // Show the text!
    composer.showText(
      "PDFClown",
      new Point2D.Double(
        0,
        templateSize.getHeight() - composer.getState().getFont().getAscent(composer.getState().getFontSize())
        )
      );

    // Drawing the side rectangle...
    composer.drawRectangle(
      new Rectangle2D.Double(
        templateSize.getWidth() - 50,
        0,
        50,
        templateSize.getHeight()
        )
      );
    composer.fill();
    composer.end();

    // Showing the side text inside the common content stream...
    composer.beginLocalState();
    composer.setFont(
      new StandardType1Font(
        document,
        StandardType1Font.FamilyEnum.Helvetica,
        false,
        false
        ),
      8
      );
    composer.setFillColor(
      new DeviceRGBColor(1,1,1)
      );
    composer.beginLocalState();
    composer.rotate(
      90,
      new Point2D.Double(
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

      document,
      StandardType1Font.FamilyEnum.Courier,
      true,
      false
      );
    DeviceRGBColor redColor = new DeviceRGBColor(1, 0, 0);
    int margin = 32;
    for(Page page : document.getPages())
    {
      // 2.1. Associate the page to the stamper!
      stamper.setPage(page);
View Full Code Here

    final BlockComposer blockComposer = new BlockComposer(composer);
    blockComposer.setLineSpace(new Length(.25f, UnitModeEnum.Relative));

    composer.beginLocalState();
    composer.setFillColor(
      new DeviceRGBColor(115f/255,164f/255,232f/255)
      );
    final Rectangle2D frame = new Rectangle2D.Double(
      18,
      18,
      pageSize.getWidth() * .5,
      pageSize.getHeight() * .5
      );
    blockComposer.begin(frame,AlignmentXEnum.Left,AlignmentYEnum.Top);
    composer.setFont(ResourceName_DefaultFont,24);
    blockComposer.showText("Page coordinates sample");
    Dimension2D breakSize = new Dimension(8,4);
    blockComposer.showBreak(breakSize);
    composer.setFont(ResourceName_DefaultFont,8);
    blockComposer.showText(
      "This sample shows the effects of the manipulation of the CTM (Current Transformation Matrix), "
        + "that is the mathematical device which affects the page coordinate system used to place "
        + "graphic contents onto the canvas."
      );
    blockComposer.showBreak(breakSize);
    blockComposer.showText(
      "The following steps represent the operations applied to this page's CTM in order to alter it. "
        + "Each step writes the word \"Step\" at the lower-left corner of the current page frame:"
      );
    blockComposer.showBreak(breakSize);
    for(int i = 0; i < steps.length; i++)
    {
      composer.setFillColor(colors[i]);
      blockComposer.showText("Step " + i + ")");
      composer.setFillColor(
        new DeviceRGBColor(115f/255,164f/255,232f/255)
        );
      blockComposer.showText(" " + steps[i]);
      blockComposer.showBreak(breakSize);
    }
    blockComposer.showText("Note that the approximation (" + maxCtmInversionApproximation + ") of the CTM components at step 4 is due to floating point precision limits; their exact values should be 1.0, 0.0, 0.0, 1.0, 0.0, 0.0.");
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.