Codota Logo
PdfContentByte.setColorFill
Code IndexAdd Codota to your IDE (free)

How to use
setColorFill
method
in
com.itextpdf.text.pdf.PdfContentByte

Best Java code snippets using com.itextpdf.text.pdf.PdfContentByte.setColorFill (Showing top 20 results out of 315)

  • Common ways to obtain PdfContentByte
private void myMethod () {
PdfContentByte p =
  • Codota IconPdfWriter writer;writer.getDirectContent()
  • Codota IconPdfStamper pdfStamper;pdfStamper.getOverContent(pageNum)
  • Codota IconPdfStamper pdfStamper;pdfStamper.getUnderContent(pageNum)
  • Smart code suggestions by Codota
}
origin: org.xhtmlrenderer/flying-saucer-pdf-itext5

private void ensureFillColor() {
  if (!(_color.equals(_fillColor))) {
    _fillColor = _color;
    _currentPage.setColorFill(_fillColor);
  }
}
origin: com.itextpdf/itextpdf

public void placeBarcode(PdfContentByte cb, BaseColor foreground, float moduleHeight, float moduleWidth) {
  int w = width + 2 * ws;
  int h = height + 2 * ws;
  int stride = (w + 7) / 8;
  int ptr = 0;
  cb.setColorFill(foreground);
  for (int k = 0; k < h; ++k) {
    int p = k * stride;
    for (int j = 0; j < w; ++j) {
      int b = image[p + j / 8] & 0xff;
      b <<= j % 8;
      if ((b & 0x80) != 0) {
        cb.rectangle(j * moduleWidth, (h - k - 1) * moduleHeight, moduleWidth, moduleHeight);
      }
    }
  }
  cb.fill();
}
origin: com.itextpdf/itextg

public void placeBarcode(PdfContentByte cb, BaseColor foreground, float moduleHeight, float moduleWidth) {
  int w = width + 2 * ws;
  int h = height + 2 * ws;
  int stride = (w + 7) / 8;
  int ptr = 0;
  cb.setColorFill(foreground);
  for (int k = 0; k < h; ++k) {
    int p = k * stride;
    for (int j = 0; j < w; ++j) {
      int b = image[p + j / 8] & 0xff;
      b <<= j % 8;
      if ((b & 0x80) != 0) {
        cb.rectangle(j * moduleWidth, (h - k - 1) * moduleHeight, moduleWidth, moduleHeight);
      }
    }
  }
  cb.fill();
}
origin: com.itextpdf/itextpdf

public void placeBarcode(PdfContentByte cb, BaseColor foreground, float moduleHeight, float moduleWidth) {
  paintCode();
  int stride = (bitColumns + 7) / 8;
  cb.setColorFill(foreground);
  for (int k = 0; k < codeRows; ++k) {
    int p = k * stride;
    for (int j = 0; j < bitColumns; ++j) {
      int b = outBits[p + j / 8] & 0xff;
      b <<= j % 8;
      if ((b & 0x80) != 0) {
        cb.rectangle(j * moduleWidth, (codeRows - k - 1) * moduleHeight, moduleWidth, moduleHeight);
      }
    }
  }
  cb.fill();
}
origin: com.itextpdf/itextg

public void placeBarcode(PdfContentByte cb, BaseColor foreground, float moduleHeight, float moduleWidth) {
  paintCode();
  int stride = (bitColumns + 7) / 8;
  cb.setColorFill(foreground);
  for (int k = 0; k < codeRows; ++k) {
    int p = k * stride;
    for (int j = 0; j < bitColumns; ++j) {
      int b = outBits[p + j / 8] & 0xff;
      b <<= j % 8;
      if ((b & 0x80) != 0) {
        cb.rectangle(j * moduleWidth, (codeRows - k - 1) * moduleHeight, moduleWidth, moduleHeight);
      }
    }
  }
  cb.fill();
}
origin: org.technbolts/gutenberg

public void tableLayout(PdfPTable table, float[][] width, float[] height,
            int headerRows, int rowStart, PdfContentByte[] canvas) {
  // because table is only one cell length, one can focus on using the first width
  float xmin = width[0][0];
  float xmax = width[0][1];
  float ymin = height[height.length - 1];
  float ymax = height[0];
  float d = 3;
  PdfContentByte background = canvas[PdfPTable.BASECANVAS];
  background.saveState();
  background.setColorFill(backgroundColor);
  background.roundRectangle(
      xmin - d,
      ymin - d,
      (xmax + d) - (xmin - d),
      (ymax + d) - (ymin - d),
      d + d);
  background.fill();
  background.restoreState();
}
origin: com.itextpdf/itextpdf

public void placeBarcode(PdfContentByte cb, BaseColor foreground, float moduleSide) {
  int width = bm.getWidth();
  int height = bm.getHeight();
  byte[][] mt = bm.getArray();
  cb.setColorFill(foreground);
  for (int y = 0; y < height; ++y) {
    byte[] line = mt[y];
    for (int x = 0; x < width; ++x) {
      if (line[x] == 0) {
        cb.rectangle(x * moduleSide, (height - y - 1) * moduleSide, moduleSide, moduleSide);
      }
    }
  }
  cb.fill();
}
origin: org.technbolts/gutenberg

  @Override
  public void cellLayout(PdfPCell cell, Rectangle rect, PdfContentByte[] canvas) {
    BaseColor color = colorProviders.apply(percent);
    if (color != null) {
      PdfContentByte cb = canvas[PdfPTable.BACKGROUNDCANVAS];
      cb.saveState();
      cb.setColorFill(color);
      cb.rectangle(
          rect.getLeft() + margin.marginLeft,
          rect.getBottom() + margin.marginBottom,
          rect.getWidth() * percent - (margin.marginLeft + margin.marginRight),
          rect.getHeight() - (margin.marginTop + margin.marginBottom));
      cb.fill();
      cb.restoreState();
    }
  }
}
origin: com.itextpdf/itextpdf

  cb.setColorFill(barColor);
byte bars[] = getBarsPostnet(code);
byte flip = 1;
origin: com.itextpdf/itextpdf

text.setColorFill(color);
origin: com.itextpdf/itextpdf

setColorFill(spot.getPdfSpotColor(), spot.getTint());
break;
setColorFill(devicen.getPdfDeviceNColor(), devicen.getTints());
break;
setColorFill(lab.getLabColorSpace(), lab.getL(), lab.getA(), lab.getB());
break;
origin: com.itextpdf/itextg

setColorFill(spot.getPdfSpotColor(), spot.getTint());
break;
setColorFill(devicen.getPdfDeviceNColor(), devicen.getTints());
break;
setColorFill(lab.getLabColorSpace(), lab.getL(), lab.getA(), lab.getB());
break;
origin: com.itextpdf/itextpdf

if (state.getBackgroundMode() == MetaState.OPAQUE) {
  textColor = state.getCurrentBackgroundColor();
  cb.setColorFill(textColor);
  cb.rectangle(tx, ty + descender, textWidth, ury - descender);
  cb.fill();
cb.setColorFill(textColor);
cb.beginText();
cb.setFontAndSize(bf, fontSize);
origin: cn.jeeweb/jeeweb-common-utils

content.setColorFill(BaseColor.LIGHT_GRAY);
content.setFontAndSize(base, 50);// 设置字体的大小
content.setTextMatrix(70, 200);
origin: com.itextpdf/itextpdf

backgr.setColorFill(background);
backgr.rectangle(left, bottom, right - left, top - bottom);
backgr.fill();
origin: com.itextpdf/itextg

backgr.setColorFill(background);
backgr.rectangle(left, bottom, right - left, top - bottom);
backgr.fill();
origin: com.itextpdf/itextg

setColorFill(new BaseColor(0x00, 0x00, 0x00));
arc(llx + 4f, lly + 4f, urx - 4f, ury - 4f, 0, 360);
fill();
origin: com.itextpdf/itextpdf

setColorFill(new BaseColor(0x00, 0x00, 0x00));
arc(llx + 4f, lly + 4f, urx - 4f, ury - 4f, 0, 360);
fill();
origin: com.itextpdf/itextpdf

setColorFill(new BaseColor(0xC0, 0xC0, 0xC0));
rectangle(llx + 0.5f, lly + 0.5f, urx - llx - 1f, ury - lly - 1f);
fill();
origin: com.itextpdf/itextpdf

setColorFill(new BaseColor(0xFF, 0xFF, 0xFF));
rectangle(llx + 0.5f, lly + 0.5f, urx - llx - 1f, ury -lly - 1f);
fill();
com.itextpdf.text.pdfPdfContentBytesetColorFill

Javadoc

Sets the fill color. color can be an ExtendedColor.

Popular methods of PdfContentByte

  • addTemplate
    adds a template with the given matrix.
  • createTemplate
  • beginText
    Starts the writing of text.
  • endText
    Ends the writing of text and makes the current font invalid.
  • lineTo
    Appends a straight line segment from the current point (x, y). The new current point is (x, y).
  • moveTo
    Move the current point (x, y), omitting any connecting line segment.
  • restoreState
    Restores the graphic state. saveState andrestoreState must be balanced.
  • saveState
    Saves the graphic state. saveState andrestoreState must be balanced.
  • setFontAndSize
    Set the font and the size for the subsequent text writing.
  • setLineWidth
    Changes the line width. The line width specifies the thickness of the line used to stroke a path and
  • stroke
    Strokes the path.
  • addImage
    Adds an Image to the page. The Image must have absolute positioning. The image can be placed inline.
  • stroke,
  • addImage,
  • setTextMatrix,
  • showText,
  • fill,
  • rectangle,
  • setColorStroke,
  • setGState,
  • beginLayer

Popular in Java

  • Finding current android device location
  • onCreateOptionsMenu (Activity)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • runOnUiThread (Activity)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Join (org.hibernate.mapping)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now