/** * Adds a rectangle to the current path. * * @param x x-coordinate of the starting point * @param y y-coordinate of the starting point * @param w width * @param h height */ public void rectangle(final float x, final float y, final float w, final float h) { rectangle((double) x, (double) y, (double) w, (double) h); }
/** * Adds a rectangle to the current path. * * @param x x-coordinate of the starting point * @param y y-coordinate of the starting point * @param w width * @param h height */ public void rectangle(final float x, final float y, final float w, final float h) { rectangle((double) x, (double) y, (double) w, (double) h); }
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(); }
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(); }
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(); }
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(); }
public void tableLayout(PdfPTable table, float[][] widths, float[] heights, int headerRows, int rowStart, PdfContentByte[] canvases) { int footer = widths.length - table.getFooterRows(); int header = table.getHeaderRows() - table.getFooterRows() + 1; for (int row = header; row < footer; row += 2) { int columns = widths[row].length - 1; Rectangle rect = new Rectangle(widths[row][0], heights[row], widths[row][columns], heights[row + 1]); rect.setBackgroundColor(styles.getColor(Styles.TABLE_ALTERNATE_BACKGROUND).or(Colors.VERY_LIGHT_GRAY)); rect.setBorder(Rectangle.NO_BORDER); canvases[PdfPTable.BASECANVAS].rectangle(rect); } } }
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(); }
@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(); } } }
cb.rectangle(startX, 0, x - inkSpreading, bars[k] == flip ? barHeight : size); startX += n;
cb.rectangle(x - textWidth / 2f - outlineSize / 2f, -y - outlineSize / 2f - textHeight, textWidth + outlineSize, textHeight * 2f + outlineSize);
cb.rectangle(startX, 0, x - inkSpreading, bars[k] == flip ? barHeight : size); startX += n;
float lx = colStart == 0 ? 10000 : 0; float rx = colEnd == totalCols ? 10000 : 0; canvas.rectangle(xPos - lx, -10000, w + lx + rx, PdfPRow.RIGHT_LIMIT); canvas.clip(); canvas.newPath();
graphics.rectangle(body);
graphics.rectangle(body);
textColor = state.getCurrentBackgroundColor(); cb.setColorFill(textColor); cb.rectangle(tx, ty + descender, textWidth, ury - descender); cb.fill(); cb.endText(); if (font.isUnderline()) { cb.rectangle(tx, ty - fontSize / 4, textWidth, fontSize / 15); cb.fill(); cb.rectangle(tx, ty + fontSize / 3, textWidth, fontSize / 15); cb.fill();