Package com.lowagie.text

Examples of com.lowagie.text.LwgRectangle


                        float subtract = lastBaseFactor;
                        if (nextChunk != null && nextChunk.isAttribute(Chunk.GENERICTAG))
                            subtract = 0;
                        if (nextChunk == null)
                            subtract += hangingCorrection;
                        LwgRectangle rect = new LwgRectangle(xMarker, yMarker, xMarker + width - subtract, yMarker + chunk.font().size());
                        PdfPageEvent pev = writer.getPageEvent();
                        if (pev != null)
                            pev.onGenericTag(writer, this, rect, (String)chunk.getAttribute(Chunk.GENERICTAG));
                    }
                    if (chunk.isAttribute(Chunk.PDFANNOTATION)) {
View Full Code Here


                    }
                }
            }

      // we paint the graphics of the table after looping through all the cells
      LwgRectangle tablerec = new LwgRectangle(table);
      tablerec.setBorder(table.getBorder());
      tablerec.setBorderWidth(table.getBorderWidth());
      tablerec.setBorderColor(table.getBorderColor());
      tablerec.setBackgroundColor(table.getBackgroundColor());
      PdfContentByte under = writer.getDirectContentUnder();
      under.rectangle(tablerec.rectangle(top(), indentBottom()));
      under.add(ctx.cellGraphics);
      // bugfix by Gerald Fehringer: now again add the border for the table
      // since it might have been covered by cell backgrounds
      tablerec.setBackgroundColor(null);
      tablerec = tablerec.rectangle(top(), indentBottom());
      tablerec.setBorder(table.getBorder());
      under.rectangle(tablerec);
      // end bugfix

            ctx.cellGraphics = new PdfContentByte(null);
      // if the table continues on the next page
View Full Code Here

        row = (ArrayList) rows.get(rowIndex);
        iterator = row.iterator();
        while (iterator.hasNext()) {
            PdfCell cell = (PdfCell) iterator.next();
            LwgRectangle cellRect = cell.rectangle(ctx.pagetop, indentBottom());
            if (useTop) {
                ctx.maxCellBottom = Math.max(ctx.maxCellBottom, cellRect.getTop());
            } else {
                if (ctx.currentRowspan(cell) == 1) {
                    ctx.maxCellBottom = Math.max(ctx.maxCellBottom, cellRect.getBottom());
                }
            }
        }
    }
View Full Code Here

                    }

                    ctx.cellRendered(cell, getPageNumber());
                }
                float indentBottom = Math.max(cell.getBottom(), indentBottom());
                LwgRectangle tableRect = ctx.table.rectangle(ctx.pagetop, indentBottom());
                indentBottom = Math.max(tableRect.getBottom(), indentBottom);

                // we paint the borders of the cells
                LwgRectangle cellRect = cell.rectangle(tableRect.getTop(), indentBottom);
         //cellRect.setBottom(cellRect.bottom());
                if (cellRect.getHeight() > 0) {
                    ctx.lostTableBottom = indentBottom;
                    ctx.cellGraphics.rectangle(cellRect);
                }

                // and additional graphics
View Full Code Here

        PdfTemplate tpl = new PdfTemplate();
        tpl.writer = writer;
        tpl.pdf = pdf;
        tpl.thisReference = thisReference;
        tpl.pageResources = pageResources;
        tpl.bBox = new LwgRectangle(bBox);
        tpl.group = group;
        tpl.layer = layer;
        if (matrix != null) {
            tpl.matrix = new PdfArray(matrix);
        }
View Full Code Here

        if (generateChecksum)
            ++len;
        float fullWidth = len * (6 * x + 3 * x * n) + (len - 1) * x;
        fullWidth = Math.max(fullWidth, fontX);
        float fullHeight = barHeight + fontY;
        return new LwgRectangle(fullWidth, fullHeight);
    }
View Full Code Here

    /** Creates a new event. This constructor will be used if you need to position fields with a Cell Event.
     * @throws DocumentException
     * @throws IOException*/
    public FieldPositioningEvents(PdfWriter writer, String text) throws IOException, DocumentException {
      this.fieldWriter = writer;
      TextField tf = new TextField(writer, new LwgRectangle(0, 0), text);
    tf.setFontSize(14);
    cellField = tf.getTextField();
  }  
View Full Code Here

    /** Creates a new event. This constructor will be used if you need to position fields with a Cell Event.
     * @throws DocumentException
     * @throws IOException*/
    public FieldPositioningEvents(PdfWriter writer, PdfFormField parent, String text) throws IOException, DocumentException {
      this.parent = parent;
      TextField tf = new TextField(writer, new LwgRectangle(0, 0), text);
    tf.setFontSize(14);
    cellField = tf.getTextField();
 
View Full Code Here

  public void onGenericTag(PdfWriter writer, LwgDocument document,
      LwgRectangle rect, String text) {
    rect.setBottom(rect.getBottom() - 3);
    PdfFormField field = (PdfFormField) genericChunkFields.get(text);
    if (field == null) {
      TextField tf = new TextField(writer, new LwgRectangle(rect.getLeft(padding), rect.getBottom(padding), rect.getRight(padding), rect.getTop(padding)), text);
      tf.setFontSize(14);
      try {
        field = tf.getTextField();
      } catch (Exception e) {
        throw new ExceptionConverter(e);
View Full Code Here

        PdfPatternPainter tpl = new PdfPatternPainter();
        tpl.writer = writer;
        tpl.pdf = pdf;
        tpl.thisReference = thisReference;
        tpl.pageResources = pageResources;
        tpl.bBox = new LwgRectangle(bBox);
        tpl.xstep = xstep;
        tpl.ystep = ystep;
        tpl.matrix = matrix;
        tpl.stencil = stencil;
        tpl.defaultColor = defaultColor;
View Full Code Here

TOP

Related Classes of com.lowagie.text.LwgRectangle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.