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(); }
cb.fillStroke(); } else { 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[][] 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(); }
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(); } } }
startX += n; cb.fill(); return getBarcodeSize();
cb.fill(); if (boxColor.getAlpha() < 255) { cb.restoreState();
public void strokeAndFill(){ MetaPen pen = state.getCurrentPen(); MetaBrush brush = state.getCurrentBrush(); int penStyle = pen.getStyle(); int brushStyle = brush.getStyle(); if (penStyle == MetaPen.PS_NULL) { cb.closePath(); if (state.getPolyFillMode() == MetaState.ALTERNATE) { cb.eoFill(); } else { cb.fill(); } } else { boolean isBrush = brushStyle == MetaBrush.BS_SOLID || brushStyle == MetaBrush.BS_HATCHED && state.getBackgroundMode() == MetaState.OPAQUE; if (isBrush) { if (state.getPolyFillMode() == MetaState.ALTERNATE) cb.closePathEoFillStroke(); else cb.closePathFillStroke(); } else { cb.closePathStroke(); } } }
public void strokeAndFill(){ MetaPen pen = state.getCurrentPen(); MetaBrush brush = state.getCurrentBrush(); int penStyle = pen.getStyle(); int brushStyle = brush.getStyle(); if (penStyle == MetaPen.PS_NULL) { cb.closePath(); if (state.getPolyFillMode() == MetaState.ALTERNATE) { cb.eoFill(); } else { cb.fill(); } } else { boolean isBrush = brushStyle == MetaBrush.BS_SOLID || brushStyle == MetaBrush.BS_HATCHED && state.getBackgroundMode() == MetaState.OPAQUE; if (isBrush) { if (state.getPolyFillMode() == MetaState.ALTERNATE) cb.closePathEoFillStroke(); else cb.closePathFillStroke(); } else { cb.closePathStroke(); } } }
backgr.setColorFill(background); backgr.rectangle(left, bottom, right - left, top - bottom); backgr.fill();
backgr.setColorFill(background); backgr.rectangle(left, bottom, right - left, top - bottom); backgr.fill();
setColorFill(new BaseColor(0x00, 0x00, 0x00)); arc(llx + 4f, lly + 4f, urx - 4f, ury - 4f, 0, 360); fill();
setColorFill(new BaseColor(0x00, 0x00, 0x00)); arc(llx + 4f, lly + 4f, urx - 4f, ury - 4f, 0, 360); fill();
setColorFill(new BaseColor(0xC0, 0xC0, 0xC0)); rectangle(llx + 0.5f, lly + 0.5f, urx - llx - 1f, ury - lly - 1f); fill();
setColorFill(new BaseColor(0xFF, 0xFF, 0xFF)); rectangle(llx + 0.5f, lly + 0.5f, urx - llx - 1f, ury -lly - 1f); fill();
setColorFill(new BaseColor(0xFF, 0xFF, 0xFF)); rectangle(llx + 0.5f, lly + 0.5f, urx - llx - 1f, ury -lly - 1f); fill();