List of usage examples for com.lowagie.text Rectangle getBottom
public float getBottom()
From source file:ch.gpb.elexis.kgexporter.pdf.HeaderFooterPageEvent.java
License:Open Source License
public void onEndPage(PdfWriter writer, Document document) { Rectangle rect = writer.getBoxSize("art"); ColumnText.showTextAligned(writer.getDirectContent(), Element.ALIGN_LEFT, new Phrase(this.sbFooter), rect.getLeft(), rect.getBottom(), 0); /*//from www . j a va2 s. c o m ColumnText.showTextAligned(writer.getDirectContent(), Element.ALIGN_CENTER, new Phrase("Bottom Right"), rect.getRight(), rect.getBottom(), 0); */ PdfContentByte cb = writer.getDirectContentUnder(); cb.setLineWidth(0.5f); cb.moveTo(30, 50); cb.lineTo(559, 50); cb.stroke(); }
From source file:com.estate.pdf.Page.java
protected Rectangle adjustPlacement(Rectangle rctIn) { Rectangle rctOut = new Rectangle(rctIn); rctOut.setLeft(rctOut.getLeft() - _1_4TH); rctOut.setBottom(rctOut.getBottom() - _1_4TH); return rctOut; }
From source file:com.estate.pdf.Page.java
protected void drawFilledRect(Rectangle rct, Color color) { PdfContentByte cb = writer.getDirectContentUnder(); // Do the lower left box cb.setLineWidth(0);//from w ww . j av a 2 s.c om cb.setRGBColorStroke(255, 255, 255); cb.rectangle(rct.getLeft(), rct.getBottom(), rct.getWidth(), rct.getHeight()); cb.setColorFill(color); cb.closePathFillStroke(); }
From source file:com.estate.pdf.Page.java
protected void drawRectangle(Rectangle rct, Color color) { drawLine(rct.getLeft(), rct.getTop(), rct.getLeft(), rct.getBottom(), color); // Left drawLine(rct.getLeft(), rct.getTop(), rct.getRight(), rct.getTop(), color); // Top drawLine(rct.getRight(), rct.getTop(), rct.getRight(), rct.getBottom(), color); // right drawLine(rct.getLeft(), rct.getBottom(), rct.getRight(), rct.getBottom(), color); // Bottom }
From source file:com.estate.pdf.Page.java
protected Rectangle toPage(float orgX, float orgY, Rectangle orgRect) { Rectangle rct = new Rectangle(orgRect); rct.setLeft(rct.getLeft() + orgX);// w ww. j a v a 2 s . co m rct.setRight(rct.getRight() + orgX); rct.setTop(rct.getTop() + orgY); rct.setBottom(rct.getBottom() + orgY); return rct; }
From source file:com.estate.pdf.Page.java
protected Rectangle translateRect(Rectangle rct) { Rectangle rctPage = new Rectangle(document.getPageSize()); rct = new Rectangle(rct.getLeft(), rctPage.getTop() - rct.getBottom(), rct.getRight(), rctPage.getTop() - rct.getTop()); return (rct); }
From source file:com.estate.report.Scenario.java
public Rectangle placeHeading() { Rectangle rect = new Rectangle(document.getPageSize()); BaseFont font = PageUtils.LoadFont("GARA.TTF"); rect.setBottom(rect.getTop() - (72 * .6f)); HeadingText ht = new HeadingText(this.writer); rect.setBottom(rect.getBottom() - (72 * .33f)); ht.setColor(57, 57, 57);/* w ww.j a v a 2s .co m*/ ht.setCapsColor(98, 98, 98); if (sc1) ht.display(rect, 12f, font, 3f, heading, HeadingText.DHT_CENTER); else ht.display(rect, 12f, font, 3f, heading2, HeadingText.DHT_CENTER); rect.setTop(rect.getBottom() - _1_8TH); rect.setBottom(prctFull.getBottom()); rect.setLeft(_1_2TH); rect.setRight(rect.getLeft() + (11.f * 72)); PageBorder pb = new PageBorder(writer); pb.setLicense(userInfo.getPlannerFirstName() + " " + userInfo.getPlannerLastName()); pb.drawNoBorder(document, Integer.toString(pageNum)); try { Rectangle rct = new Rectangle(document.getPageSize()); float iconBase = (.75f * 72); // This is the base of the icons on // the page Image icon = Image.getInstance(Locations.getImageLocation() + "pawn.png"); // Image box = Image.getInstance(Locations.ImageLocation() + // "blueBOX.png"); icon.scalePercent(23); float scale = .23f; float iconLeft = (icon.getWidth() / 2) * scale; // Adjust the top rct.setTop(rct.getTop()); // Place the Icon icon.setAbsolutePosition((.5f * 72) - iconLeft, rct.getTop() - iconBase); document.add(icon); } catch (Exception e) { System.err.println(e.getMessage()); } drawLifeExp(); return rect; }
From source file:com.estate.report.Scenario.java
public void page1() { float tallest = 0; int colCount = MAX_COLS; CFRow continueRow = null;/*from www. j a v a 2s.c om*/ float baseWidths[] = initWidths(colCount - 1); float widths[] = calcWidths(baseWidths, 11f * 72); drawHeader(userInfo.getClientHeading(), ""); Rectangle agt = placeHeading(); Rectangle rct = new Rectangle(prctFull); rct.setLeft(_1_4TH); rct.setRight(rct.getLeft() + 756); Rectangle r = doRow(leList(), widths, agt, 17); rct.setTop(r.getBottom()); r = doRow(agesList(), widths, rct, 17); rct.setTop(r.getBottom()); r = doRow(fiscalYearList(), widths, rct, 17); rct.setTop(r.getBottom()); tallest = tallest < r.getHeight() ? r.getHeight() : tallest; for (CFRow row : rowList) { boolean flag = false; if (row.getColNumber() == 0 && row.getIndentLevel() == 0) { continueRow = row; } do { flag = false; String pdfRow[] = buildRow(row, colCount); if (row.isNewPage()) { newPage(); drawHeader(userInfo.getClientHeading(), ""); agt = placeHeading(); //rct = new Rectangle(prctFull); rct.setLeft(_1_4TH); rct.setRight(rct.getLeft() + 756); r = doRow(leList(), widths, agt, 17); rct.setTop(r.getBottom()); r = doRow(agesList(), widths, rct, 17); rct.setTop(r.getBottom()); r = doRow(fiscalYearList(), widths, rct, 17); rct.setTop(r.getBottom()); tallest = tallest < r.getHeight() ? r.getHeight() : tallest; if (continueRow != null) { if (!row.equals(continueRow)) { row = continueRow; row.setHeader(row.getHeader() + " (cont.)"); flag = true; } } } r = doRow(pdfRow, widths, rct, colCount - 1); rct.setTop(r.getBottom()); tallest = tallest < r.getHeight() ? r.getHeight() : tallest; } while (flag == true); } }
From source file:com.estate.report.Scenario.java
public Rectangle nextPage(float[] widths) { newPage();/*from www .j a v a 2s. c om*/ String user = userInfo.getClientHeading(); drawHeader(user, ""); Rectangle agt = placeHeading(); Rectangle rct = new Rectangle(prctFull); rct.setLeft(_1_4TH); rct.setRight(rct.getLeft() + 756); Rectangle r = null; r = doRow(leList(), widths, agt, 17); rct.setTop(r.getBottom()); r = doRow(agesList(), widths, rct, 17); rct.setTop(r.getBottom()); rct.setTop(r.getBottom()); r = doRow(fiscalYearList(), widths, rct, 17); rct.setTop(r.getBottom()); return rct; }
From source file:com.teag.reports.CashFlows.java
private void page1() { CashFlowTable cft = new CashFlowTable(); ClientBean cb = new ClientBean(); CFRow row;//from w w w. j av a 2s. c o m CFRow continueRow = null; float tallest = 0; cb.setPrimaryId(clientID); cft.setCb(cb); cft.init(); cft.genTable(); cft.reset(); int colCount = MAX_ROWS; drawHeader(userInfo.getClientHeading(), ""); Rectangle agt = placeHeading(); float baseWidths[] = this.initWidths(colCount - 1); float widths[] = this.calcWidths(baseWidths, 11.f * 72); Rectangle rct = new Rectangle(prctFull); rct.setLeft(_1_4TH); rct.setRight(rct.getLeft() + 756); Rectangle r = doRow(leList(), widths, agt, 17); rct.setTop(r.getBottom()); r = doRow(agesList(), widths, rct, 17); rct.setTop(r.getBottom()); r = doRow(fiscalYearList(), widths, rct, 17); rct.setTop(r.getBottom()); tallest = tallest < r.getHeight() ? r.getHeight() : tallest; while ((row = cft.getRow()) != null) { boolean flag; if (row.getColNumber() == 0 && row.getIndentLevel() == 0) { continueRow = row; } do { flag = false; boolean nPage = false; String pdfRow[] = buildRow(row, colCount); if (row.getHeader().startsWith("III.") && !row.getHeader().endsWith("(cont.)")) { nPage = true; } if (row.getHeader().startsWith("IV.") && !row.getHeader().endsWith("(cont.)")) { nPage = true; } // Rectangle r = doSimpleRow(pdfRow, rct); if (nPage) { // need to span to a new page newPage(); drawHeader(client, ""); agt = placeHeading(); rct.setLeft(_1_4TH); rct.setRight(rct.getLeft() + 756); r = doRow(leList(), widths, agt, 17); rct.setTop(r.getBottom()); r = doRow(agesList(), widths, rct, 17); rct.setTop(r.getBottom()); r = doRow(fiscalYearList(), widths, rct, 17); rct.setTop(r.getBottom()); tallest = tallest < r.getHeight() ? r.getHeight() : tallest; if (continueRow != null) { if (!row.equals(continueRow)) { row = continueRow; row.setHeader(row.getHeader() + " (cont.)"); flag = true; } } nPage = false; } r = this.doRow(pdfRow, widths, rct, colCount - 1); tallest = tallest < r.getHeight() ? r.getHeight() : tallest; rct.setTop(r.getBottom()); if (rct.getTop() < (.5f * 72) + tallest) { // need to span to a new page newPage(); drawHeader(client, ""); agt = placeHeading(); rct.setLeft(_1_4TH); rct.setRight(rct.getLeft() + 756); r = doRow(leList(), widths, agt, 17); rct.setTop(r.getBottom()); r = doRow(agesList(), widths, rct, 17); rct.setTop(r.getBottom()); r = doRow(fiscalYearList(), widths, rct, 17); rct.setTop(r.getBottom()); tallest = tallest < r.getHeight() ? r.getHeight() : tallest; if (continueRow != null) { if (!row.equals(continueRow)) { row = continueRow; row.setHeader(row.getHeader() + " (cont.)"); flag = true; } } } } while (flag == true); } cft.cleanUp(); }