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

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

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

Rectangle.getBottom介绍

[英]Returns the lower left y-coordinate.
[中]返回左下角的y坐标。

代码示例

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

public void onEndPage(PdfWriter writer, Document document)
 {
   Rectangle rect = writer.getBoxSize("art");
   ColumnText.showTextAligned(writer.getDirectContent(),
       Element.ALIGN_RIGHT, new Phrase("My static header text"),
       rect.getRight(), rect.getTop(), 0);
   ColumnText.showTextAligned(writer.getDirectContent(),
       Element.ALIGN_CENTER, new Phrase(String.format("page %d", pagenumber)),
       (rect.getLeft() + rect.getRight()) / 2, rect.getBottom() - 18, 0);
 }

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

/**
 * Returns the lower left y-coordinate.
 *
 * @return        the lower left y-coordinate
 */
public float getBottom() {
  return super.getBottom(cellspacing);
}

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

(rect.getLeft() + rect.getRight()) / 2, rect.getBottom() - 18, 0);

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

/**
* Returns the lower left y-coordinate, considering a given margin.
*
  * @param margin
  *            a margin
* @return    the lower left y-coordinate
*/
 
 public float bottom(float margin) {
   return pageSize.getBottom(marginBottom + margin);
 }

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

/**
* Returns the lower left y-coordinate, considering a given margin.
*
  * @param margin
  *            a margin
* @return    the lower left y-coordinate
*/
 
 public float bottom(float margin) {
   return pageSize.getBottom(marginBottom + margin);
 }

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

/**
* Returns the lower left y-coordinate.
*
* @return    the lower left y-coordinate
*/
 
 public float bottom() {
   return pageSize.getBottom(marginBottom);
 }

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

/**
* Returns the lower left y-coordinate.
*
* @return    the lower left y-coordinate
*/
 
 public float bottom() {
   return pageSize.getBottom(marginBottom);
 }

代码示例来源:origin: org.xhtmlrenderer/flying-saucer-pdf-openpdf

private com.lowagie.text.Rectangle add(com.lowagie.text.Rectangle r1, com.lowagie.text.Rectangle r2) {
  float llx = Math.min(r1.getLeft(), r2.getLeft());
  float urx = Math.max(r1.getRight(), r2.getRight());
  float lly = Math.min(r1.getBottom(), r2.getBottom());
  float ury = Math.max(r1.getTop(), r2.getTop());
  return new com.lowagie.text.Rectangle(llx, lly, urx, ury);
}

代码示例来源:origin: org.docx4j/xhtmlrenderer

private com.lowagie.text.Rectangle add(com.lowagie.text.Rectangle r1, com.lowagie.text.Rectangle r2) {
  float llx = Math.min(r1.getLeft(), r2.getLeft());
  float urx = Math.max(r1.getRight(), r2.getRight());
  float lly = Math.min(r1.getBottom(), r2.getBottom());
  float ury = Math.max(r1.getTop(), r2.getTop());
  return new com.lowagie.text.Rectangle(llx, lly, urx, ury);
}

代码示例来源:origin: org.xhtmlrenderer/core-renderer

private com.lowagie.text.Rectangle add(com.lowagie.text.Rectangle r1, com.lowagie.text.Rectangle r2) {
  float llx = Math.min(r1.getLeft(), r2.getLeft());
  float urx = Math.max(r1.getRight(), r2.getRight());
  float lly = Math.min(r1.getBottom(), r2.getBottom());
  float ury = Math.max(r1.getTop(), r2.getTop());
  
  return new com.lowagie.text.Rectangle(llx, lly, urx, ury);
}

代码示例来源:origin: org.xhtmlrenderer/flying-saucer-pdf

private com.lowagie.text.Rectangle add(com.lowagie.text.Rectangle r1, com.lowagie.text.Rectangle r2) {
  float llx = Math.min(r1.getLeft(), r2.getLeft());
  float urx = Math.max(r1.getRight(), r2.getRight());
  float lly = Math.min(r1.getBottom(), r2.getBottom());
  float ury = Math.max(r1.getTop(), r2.getTop());
  return new com.lowagie.text.Rectangle(llx, lly, urx, ury);
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

private com.lowagie.text.Rectangle add(com.lowagie.text.Rectangle r1, com.lowagie.text.Rectangle r2) {
  float llx = Math.min(r1.getLeft(), r2.getLeft());
  float urx = Math.max(r1.getRight(), r2.getRight());
  float lly = Math.min(r1.getBottom(), r2.getBottom());
  float ury = Math.max(r1.getTop(), r2.getTop());
  return new com.lowagie.text.Rectangle(llx, lly, urx, ury);
}

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

/**
 * Constructs a <CODE>PdfRectangle</CODE>-object with a <CODE>Rectangle</CODE>-object.
 *
 * @param    rectangle    a <CODE>Rectangle</CODE>
 */

  public PdfRectangle(Rectangle rectangle, int rotation) {
    this(rectangle.getLeft(), rectangle.getBottom(), rectangle.getRight(), rectangle.getTop(), rotation);
  }

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

/**
 * Constructs a <CODE>PdfRectangle</CODE>-object with a <CODE>Rectangle</CODE>-object.
 *
 * @param    rectangle    a <CODE>Rectangle</CODE>
 */

  public PdfRectangle(Rectangle rectangle, int rotation) {
    this(rectangle.getLeft(), rectangle.getBottom(), rectangle.getRight(), rectangle.getTop(), rotation);
  }

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

private void underlineText(String fieldName, String fieldValue, AcroFields fields, PdfStamper stamper) throws Exception
{
  Rectangle targetPosition = fields.getFieldPositions(fieldName).get(0).position;
  Font fontNormal = FontFactory.getFont("Courier-Bold", 8, Font.UNDERLINE, BaseColor.BLACK);
  Anchor url = new Anchor(fieldValue.trim(), fontNormal);
  ColumnText data = new ColumnText(stamper.getOverContent(1));
  data.setSimpleColumn(url, targetPosition.getLeft(), targetPosition.getBottom(), targetPosition.getRight(), targetPosition.getTop(), 0,0);
  data.go();
}

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

PdfImportedPage(PdfReaderInstance readerInstance, PdfWriter writer, int pageNumber) {
  this.readerInstance = readerInstance;
  this.pageNumber = pageNumber;
  this.writer = writer;
  bBox = readerInstance.getReader().getPageSize(pageNumber);
  setMatrix(1, 0, 0, 1, -bBox.getLeft(), -bBox.getBottom());
  type = TYPE_IMPORTED;
}

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

PdfImportedPage(PdfReaderInstance readerInstance, PdfWriter writer, int pageNumber) {
  this.readerInstance = readerInstance;
  this.pageNumber = pageNumber;
  this.writer = writer;
  bBox = readerInstance.getReader().getPageSize(pageNumber);
  setMatrix(1, 0, 0, 1, -bBox.getLeft(), -bBox.getBottom());
  type = TYPE_IMPORTED;
}

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

public class MyBorder implements PdfPCellEvent {
  public void cellLayout(PdfPCell cell, Rectangle position,
    PdfContentByte[] canvases) {
    float x1 = position.getLeft() + 2;
    float x2 = position.getRight() - 2;
    float y1 = position.getTop() - 2;
    float y2 = position.getBottom() + 2;
    PdfContentByte canvas = canvases[PdfPTable.LINECANVAS];
    canvas.rectangle(x1, y1, x2 - x1, y2 - y1);
    canvas.stroke();
  }
}

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

public void addAnnotation(PdfWriter writer,
   Document document, Rectangle rect, String text) {
   PdfAnnotation annotation = new PdfAnnotation(writer,
     new Rectangle(
       rect.getRight() + 10, rect.getBottom(),
       rect.getRight() + 30, rect.getTop()));
   annotation.setTitle("Text annotation");
   annotation.put(PdfName.SUBTYPE, PdfName.TEXT);
   annotation.put(PdfName.OPEN, PdfBoolean.PDFFALSE);
   annotation.put(PdfName.NAME, new PdfName(text));
   writer.addAnnotation(annotation);
 }

代码示例来源: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 rect, PdfContentByte[] canvases) {
    if (cellField == null || (fieldWriter == null && parent == null)) throw new IllegalArgumentException(MessageLocalization.getComposedMessage("you.have.used.the.wrong.constructor.for.this.fieldpositioningevents.class"));
    cellField.put(PdfName.RECT, new PdfRectangle(rect.getLeft(padding), rect.getBottom(padding), rect.getRight(padding), rect.getTop(padding)));
    if (parent == null)
      fieldWriter.addAnnotation(cellField);
    else
      parent.addKid(cellField);
  }
}

相关文章

微信公众号

最新文章

更多