com.lowagie.text.Rectangle.setBackgroundColor()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中com.lowagie.text.Rectangle.setBackgroundColor方法的一些代码示例,展示了Rectangle.setBackgroundColor的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rectangle.setBackgroundColor方法的具体详情如下:
包路径:com.lowagie.text.Rectangle
类名称:Rectangle
方法名:setBackgroundColor

Rectangle.setBackgroundColor介绍

[英]Sets the backgroundcolor of the rectangle.
[中]

代码示例

代码示例来源:origin: stackoverflow.com

PdfContentByte canvas = writer.getDirectContent();
Rectangle rect1 = new Rectangle(llx, lly, urx, ury);
rect1.setBackgroundColor(BaseColor.LIGHT_GRAY);
rect1.setBorder(Rectangle.BOX);
rect1.setBorderWidth(1);
canvas.rectangle(rect1);

代码示例来源:origin: stackoverflow.com

Rectangle rect2 = new Rectangle(llx + 60, lly, urx, ury - 40);
rect2.setBackgroundColor(BaseColor.DARK_GRAY);
rect2.setBorder(Rectangle.BOX);
rect2.setBorderColor(BaseColor.WHITE);
rect2.setBorderWidth(0.5f);
canvas.rectangle(rect2);

代码示例来源:origin: com.github.librepdf/openpdf

if (b != null)
    blue = Integer.parseInt(b);
  rect.setBackgroundColor(new Color(red, green, blue));
} else if (value != null) {
  rect.setBackgroundColor(Markup.decodeColor(value));
} else {
  value = attributes.getProperty(ElementTags.GRAYFILL);

代码示例来源:origin: es.gob.afirma/afirma-crypto-pdf-itext

if (b != null)
    blue = Integer.parseInt(b);
  rect.setBackgroundColor(new Color(red, green, blue));
} else if (value != null) {
  rect.setBackgroundColor(Markup.decodeColor(value));
} else {
  value = attributes.getProperty(ElementTags.GRAYFILL);

代码示例来源:origin: es.gob.afirma/afirma-crypto-pdf-itext

/**
 * @see com.lowagie.text.pdf.PdfPCellEvent#cellLayout(com.lowagie.text.pdf.PdfPCell, com.lowagie.text.Rectangle, com.lowagie.text.pdf.PdfContentByte[])
 */
public void cellLayout(PdfPCell cell, Rectangle position, PdfContentByte[] canvases) {
  float sp_left = spacing_left;
  if (Float.isNaN(sp_left)) sp_left = 0f;
  float sp_right = spacing_right;
  if (Float.isNaN(sp_right)) sp_right = 0f;
  float sp_top = spacing_top;
  if (Float.isNaN(sp_top)) sp_top = 0f;
  float sp_bottom = spacing_bottom;
  if (Float.isNaN(sp_bottom)) sp_bottom = 0f;
  Rectangle rect = new Rectangle(position.getLeft(sp_left), position.getBottom(sp_bottom), position.getRight(sp_right), position.getTop(sp_top));
  rect.cloneNonPositionParameters(this);
  canvases[PdfPTable.BACKGROUNDCANVAS].rectangle(rect);
  rect.setBackgroundColor(null);
  canvases[PdfPTable.LINECANVAS].rectangle(rect);
}

代码示例来源:origin: fr.opensagres.xdocreport.itext-gae/itext-gae

/**
 * @see com.lowagie.text.pdf.PdfPCellEvent#cellLayout(com.lowagie.text.pdf.PdfPCell, com.lowagie.text.Rectangle, com.lowagie.text.pdf.PdfContentByte[])
 */
public void cellLayout(PdfPCell cell, Rectangle position, PdfContentByte[] canvases) {
  float sp_left = spacing_left;
  if (Float.isNaN(sp_left)) sp_left = 0f;
  float sp_right = spacing_right;
  if (Float.isNaN(sp_right)) sp_right = 0f;
  float sp_top = spacing_top;
  if (Float.isNaN(sp_top)) sp_top = 0f;
  float sp_bottom = spacing_bottom;
  if (Float.isNaN(sp_bottom)) sp_bottom = 0f;
  Rectangle rect = new Rectangle(position.getLeft(sp_left), position.getBottom(sp_bottom), position.getRight(sp_right), position.getTop(sp_top));
  rect.cloneNonPositionParameters(this);
  canvases[PdfPTable.BACKGROUNDCANVAS].rectangle(rect);
  rect.setBackgroundColor(null);
  canvases[PdfPTable.LINECANVAS].rectangle(rect);
}

代码示例来源:origin: com.github.librepdf/openpdf

/**
 * @see com.lowagie.text.pdf.PdfPCellEvent#cellLayout(com.lowagie.text.pdf.PdfPCell, com.lowagie.text.Rectangle, com.lowagie.text.pdf.PdfContentByte[])
 */
public void cellLayout(PdfPCell cell, Rectangle position, PdfContentByte[] canvases) {
  float sp_left = spacing_left;
  if (Float.isNaN(sp_left)) sp_left = 0f;
  float sp_right = spacing_right;
  if (Float.isNaN(sp_right)) sp_right = 0f;
  float sp_top = spacing_top;
  if (Float.isNaN(sp_top)) sp_top = 0f;
  float sp_bottom = spacing_bottom;
  if (Float.isNaN(sp_bottom)) sp_bottom = 0f;
  Rectangle rect = new Rectangle(position.getLeft(sp_left), position.getBottom(sp_bottom), position.getRight(sp_right), position.getTop(sp_top));
  rect.cloneNonPositionParameters(this);
  canvases[PdfPTable.BACKGROUNDCANVAS].rectangle(rect);
  rect.setBackgroundColor(null);
  canvases[PdfPTable.LINECANVAS].rectangle(rect);
}

代码示例来源:origin: fr.opensagres.xdocreport.itext-gae/itext-gae

if (b != null)
    blue = Integer.parseInt(b);
  rect.setBackgroundColor(new Color(red, green, blue));
} else if (value != null) {
  rect.setBackgroundColor(Markup.decodeColor(value));
} else {
  value = attributes.getProperty(ElementTags.GRAYFILL);

代码示例来源:origin: fr.opensagres.xdocreport.itext-gae/itext-gae

/**
 * @see com.lowagie.text.pdf.PdfPTableEvent#tableLayout(com.lowagie.text.pdf.PdfPTable, float[][], float[], int, int, com.lowagie.text.pdf.PdfContentByte[])
 */
public void tableLayout(PdfPTable table, float[][] widths, float[] heights, int headerRows, int rowStart, PdfContentByte[] canvases) {
  float[] width = widths[0];
  Rectangle rect = new Rectangle(width[0], heights[heights.length - 1], width[width.length - 1], heights[0]);
  rect.cloneNonPositionParameters(this);
  int bd = rect.getBorder();
  rect.setBorder(Rectangle.NO_BORDER);
  canvases[PdfPTable.BACKGROUNDCANVAS].rectangle(rect);
  rect.setBorder(bd);
  rect.setBackgroundColor(null);
  canvases[PdfPTable.LINECANVAS].rectangle(rect);
}

代码示例来源:origin: es.gob.afirma/afirma-crypto-pdf-itext

/**
 * @see com.lowagie.text.pdf.PdfPTableEvent#tableLayout(com.lowagie.text.pdf.PdfPTable, float[][], float[], int, int, com.lowagie.text.pdf.PdfContentByte[])
 */
public void tableLayout(PdfPTable table, float[][] widths, float[] heights, int headerRows, int rowStart, PdfContentByte[] canvases) {
  float[] width = widths[0];
  Rectangle rect = new Rectangle(width[0], heights[heights.length - 1], width[width.length - 1], heights[0]);
  rect.cloneNonPositionParameters(this);
  int bd = rect.getBorder();
  rect.setBorder(Rectangle.NO_BORDER);
  canvases[PdfPTable.BACKGROUNDCANVAS].rectangle(rect);
  rect.setBorder(bd);
  rect.setBackgroundColor(null);
  canvases[PdfPTable.LINECANVAS].rectangle(rect);
}

代码示例来源:origin: com.github.librepdf/openpdf

/**
 * @see com.lowagie.text.pdf.PdfPTableEvent#tableLayout(com.lowagie.text.pdf.PdfPTable, float[][], float[], int, int, com.lowagie.text.pdf.PdfContentByte[])
 */
public void tableLayout(PdfPTable table, float[][] widths, float[] heights, int headerRows, int rowStart, PdfContentByte[] canvases) {
  float[] width = widths[0];
  Rectangle rect = new Rectangle(width[0], heights[heights.length - 1], width[width.length - 1], heights[0]);
  rect.cloneNonPositionParameters(this);
  int bd = rect.getBorder();
  rect.setBorder(Rectangle.NO_BORDER);
  canvases[PdfPTable.BACKGROUNDCANVAS].rectangle(rect);
  rect.setBorder(bd);
  rect.setBackgroundColor(null);
  canvases[PdfPTable.LINECANVAS].rectangle(rect);
}

代码示例来源:origin: com.github.librepdf/openpdf

tablerec.setBorderWidth(table.getBorderWidth());
tablerec.setBorderColor(table.getBorderColor());
tablerec.setBackgroundColor(table.getBackgroundColor());
PdfContentByte under = writer.getDirectContentUnder();
under.rectangle(tablerec.rectangle(top(), indentBottom()));
tablerec.setBackgroundColor(null);
tablerec = tablerec.rectangle(top(), indentBottom());
tablerec.setBorder(table.getBorder());

代码示例来源:origin: fr.opensagres.xdocreport.itext-gae/itext-gae

tablerec.setBorderWidth(table.getBorderWidth());
tablerec.setBorderColor(table.getBorderColor());
tablerec.setBackgroundColor(table.getBackgroundColor());
PdfContentByte under = writer.getDirectContentUnder();
under.rectangle(tablerec.rectangle(top(), indentBottom()));
tablerec.setBackgroundColor(null);
tablerec = tablerec.rectangle(top(), indentBottom());
tablerec.setBorder(table.getBorder());

代码示例来源:origin: com.github.librepdf/openpdf

newRect.setBackgroundColor(null);

代码示例来源:origin: es.gob.afirma/afirma-crypto-pdf-itext

tablerec.setBorderWidth(table.getBorderWidth());
tablerec.setBorderColor(table.getBorderColor());
tablerec.setBackgroundColor(table.getBackgroundColor());
PdfContentByte under = writer.getDirectContentUnder();
under.rectangle(tablerec.rectangle(top(), indentBottom()));
tablerec.setBackgroundColor(null);
tablerec = tablerec.rectangle(top(), indentBottom());
tablerec.setBorder(table.getBorder());

代码示例来源:origin: fr.opensagres.xdocreport.itext-gae/itext-gae

newRect.setBackgroundColor(null);

代码示例来源:origin: es.gob.afirma/afirma-crypto-pdf-itext

newRect.setBackgroundColor(null);

代码示例来源:origin: org.jboss.seam/jboss-seam-pdf

if (backgroundColor != null)
  rectangle.setBackgroundColor(ITextUtils.colorValue(backgroundColor));

相关文章

微信公众号

最新文章

更多