Examples of GrayColor


Examples of com.itextpdf.text.pdf.GrayColor

   * Sets the the background color to a grayscale value.
   *
   * @param value  the new grayscale value
   */
  public void setGrayFill(final float value) {
        backgroundColor = new GrayColor(value);
  }
View Full Code Here

Examples of com.itextpdf.text.pdf.GrayColor

   * Sets the the background color to a grayscale value.
   *
   * @param value  the new grayscale value
   */
  public void setGrayFill(final float value) {
        backgroundColor = new GrayColor(value);
  }
View Full Code Here

Examples of com.itextpdf.text.pdf.GrayColor

   * Sets the the background color to a grayscale value.
   *
   * @param value  the new grayscale value
   */
  public void setGrayFill(float value) {
        backgroundColor = new GrayColor(value);
  }
View Full Code Here

Examples of com.itextpdf.text.pdf.GrayColor

      for (int i = 0; i < nOperands; i++) {
        c[i] = ((PdfNumber)operands.get(i)).floatValue();
      }
      switch (nOperands) {
      case 1:
        return new GrayColor(c[0]);
      case 3:
        return new BaseColor(c[0], c[1], c[2]);
      case 4:
        return new CMYKColor(c[0], c[1], c[2], c[3]);
      }
View Full Code Here

Examples of com.itextpdf.text.pdf.GrayColor

   * Sets the the background color to a grayscale value.
   *
   * @param value  the new grayscale value
   */
  public void setGrayFill(final float value) {
        backgroundColor = new GrayColor(value);
  }
View Full Code Here

Examples of com.itextpdf.text.pdf.GrayColor

   * Sets the the background color to a grayscale value.
   *
   * @param value  the new grayscale value
   */
  public void setGrayFill(final float value) {
        backgroundColor = new GrayColor(value);
  }
View Full Code Here

Examples of com.lowagie.text.pdf.GrayColor

   *
   * @param value
   *            the new value
   */
  public void setGrayFill(float value) {
        backgroundColor = new GrayColor(value);
  }
View Full Code Here

Examples of com.lowagie.text.pdf.GrayColor

   * Sets the the background color to a grayscale value.
   *
   * @param value  the new grayscale value
   */
  public void setGrayFill(float value) {
        backgroundColor = new GrayColor(value);
  }
View Full Code Here

Examples of com.lowagie.text.pdf.GrayColor

            // See if we can apply the pattern color to chunk, phrase or paragraph
            PatternColor pat = new PatternColor(p);
            PatternColor pat1 = new PatternColor(p1);
            PatternColor pat2 = new PatternColor(p2);
            String text = "Text with pattern";
            document.add(new Paragraph(text, FontFactory.getFont(FontFactory.HELVETICA, 60, LwgFont.BOLD, new GrayColor(0.3f))));
            document.add(new Paragraph(text, FontFactory.getFont(FontFactory.HELVETICA, 60, LwgFont.BOLD, pat)));
           
            // draw a rectangle filled with star pattern
            cb.setPatternFill(p);
            cb.setGrayStroke(0.0f);
            cb.rectangle(20, 20, 284, 120);
            cb.fillStroke();
           
            // draw some characters filled with star.
            // Note: A gray, rgb, cmyk or spot color should be applied first
            // otherwise, you will not be able to see the character glyph
            // since the glyph path is filled by pattern
            cb.beginText();
            cb.setFontAndSize(bf, 1);
            cb.setTextMatrix(270f, 0f, 0f, 270f, 20f, 100f);
            cb.setGrayFill(0.9f);
            cb.showText("ABC");
            cb.setPatternFill(p);
            cb.moveTextWithLeading(0.0f, 0.0f);
            cb.showText("ABC");
            cb.endText();
            cb.setPatternFill(p);
           
            // draw a circle. Similar to rectangle
            cb.setGrayStroke(0.0f);
            cb.circle(150f, 400f, 150f);
            cb.fillStroke();
           
            // New Page to draw text in the pattern painter's canvas
            document.newPage();
           
            document.add(new Paragraph(text, FontFactory.getFont(FontFactory.HELVETICA, 60, LwgFont.BOLD, new GrayColor(0.3f))));
            document.add(new Paragraph(text, FontFactory.getFont(FontFactory.HELVETICA, 60, LwgFont.BOLD, pat1)));
            // draw a rectangle
            cb.setPatternFill(p1);
            cb.setGrayStroke(0.0f);
            cb.rectangle(0, 0, 284, 120);
            cb.fillStroke();
           
            // draw some characters
            cb.beginText();
            cb.setFontAndSize(bf, 1);
            cb.setTextMatrix(270f, 0f, 0f, 270f, 20f, 100f);
            cb.setGrayFill(0.9f);
            cb.showText("ABC");
            cb.setPatternFill(p1);
            cb.moveTextWithLeading(0.0f, 0.0f);
            cb.showText("ABC");
            cb.endText();
           
            // draw a circle
            cb.setPatternFill(p1);
            cb.setGrayStroke(0.0f);
            cb.circle(150f, 400f, 150f);
            cb.fillStroke();
            cb.sanityCheck();
           
            // New page to place image in the pattern painter's canvas
            document.newPage();
            document.add(new Paragraph(text, FontFactory.getFont(FontFactory.HELVETICA, 60, LwgFont.BOLD, new GrayColor(0.3f))));
            document.add(new Paragraph(text, FontFactory.getFont(FontFactory.HELVETICA, 60, LwgFont.BOLD, pat2)));
            // The original LwgImage for comparison reason.
            // Note: The width and height is the same as bbox in pattern
            cb.addImage(img, img.getScaledWidth(), 0f, 0f, img.getScaledHeight(), 350f, 400f);
           
View Full Code Here

Examples of com.lowagie.text.pdf.GrayColor

            // step 5: we instantiate PdfSpotColor
           
            // Note: I made up these names unless someone give me a PANTONE swatch as gift (phillip@formstar.com)
            PdfSpotColor spc_cmyk = new PdfSpotColor("PANTONE 280 CV", new CMYKColor(0.9f, .2f, .3f, .1f));
            PdfSpotColor spc_rgb = new PdfSpotColor("PANTONE 147", new Color(114, 94, 38));
            PdfSpotColor spc_g = new PdfSpotColor("PANTONE 100 CV", new GrayColor(0.9f));
           
            // Stroke a rectangle with CMYK alternate
            cb.setColorStroke(spc_cmyk, .5f);
            cb.setLineWidth(10f);
            // draw a rectangle
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.