Package com.lowagie.text

Examples of com.lowagie.text.Rectangle.height()


            try
            {
                if ( currentField.getType().equals( Rectangle.class ) )
                {
                    Rectangle fPageSize = (Rectangle) currentField.get( null );
                    if ( ( rect.width() == fPageSize.width() ) && ( rect.height() == fPageSize.height() ) )
                    {
                        return currentField.getName();
                    }
                }
            }
View Full Code Here


    }
    template.endText();

    Rectangle pageSize = reader.getPageSizeWithRotation(currentPage);
    cb.addTemplate(template, element.getChild("X").getIntValue() * globalData.xFactor,
            (((int) pageSize.height()) - element.getChild("Y").getIntValue() - Y_OFFSET) * globalData.yFactor);
  }

  private void replaceWrapped(PdfContentByte cb, PdfReader reader, int currentPage,
                              JdomElement element,
                              GlobalConfig globalData, String value, BaseFont valueFont)
View Full Code Here

    Rectangle pageSize = reader.getPageSizeWithRotation(currentPage);

    ColumnText ct = new ColumnText(cb);
    int x = element.getChild("X").getIntValue() * globalData.xFactor;
    int y = (((int) pageSize.height()) - element.getChild("Y").getIntValue() - Y_OFFSET) * globalData.yFactor;
    ct.addText(new Phrase(text, font));
    int alignCode = getAlignCode(element.getChild("HAlign"));
    switch (alignCode) {
      case ALIGN_LEFT:
        ct.setSimpleColumn(x, y, x + width, y - height, fontSize + 1, Element.ALIGN_LEFT);
View Full Code Here

    int height = element.getChild("Height").getIntValue();

    Rectangle pageSize = reader.getPageSizeWithRotation(currentPage);
    cb.addImage(image, width, 0, 0, height,
            element.getChild("X").getIntValue() * globalData.xFactor,
            (pageSize.height() - element.getChild("Y").getIntValue() - Y_OFFSET) * globalData.yFactor);
  }

  private void replaceBarcode(PdfContentByte cb, PdfReader reader, int currentPage,
                              JdomElement element, GlobalConfig globalData, String value)
          throws DocumentException {
View Full Code Here

        break;
    }

    Rectangle pageSize = reader.getPageSizeWithRotation(currentPage);
    column.setSimpleColumn(element.getChild("X").getIntValue() * globalData.xFactor,
            (((int) pageSize.height()) - element.getChild("Y").getIntValue() - Y_OFFSET) * globalData.yFactor - height,
            element.getChild("X").getIntValue() * globalData.xFactor + width,
            (((int) pageSize.height()) - element.getChild("Y").getIntValue() - Y_OFFSET) * globalData.yFactor,
            leading, alignCode);
    return column.go();
  }
View Full Code Here

    Rectangle pageSize = reader.getPageSizeWithRotation(currentPage);
    column.setSimpleColumn(element.getChild("X").getIntValue() * globalData.xFactor,
            (((int) pageSize.height()) - element.getChild("Y").getIntValue() - Y_OFFSET) * globalData.yFactor - height,
            element.getChild("X").getIntValue() * globalData.xFactor + width,
            (((int) pageSize.height()) - element.getChild("Y").getIntValue() - Y_OFFSET) * globalData.yFactor,
            leading, alignCode);
    return column.go();
  }

  private int getAlignCode(JdomElement element) {
View Full Code Here

    if ((rotation.floatValue() == 90) || (rotation.floatValue() == 270)) {
      rect = rect.rotate();
    }

    width = rect.width();
    height = rect.height();

    PdfArray dict = (PdfArray) PdfReader.getPdfObject(page.get(PdfName.ANNOTS));
    if (dict != null) {
      this.add(new ObjectTreeNode(PdfName.ANNOTS + " " + dict.length()));
      ObjectTreeNode annots_node = new ObjectTreeNode(PdfName.ANNOTS  + " " + dict.type());
View Full Code Here

        }
        p = i + 1;
        offsetX = unitSize.width() * ((i % n) % c);
        offsetY = newSize.height() - (unitSize.height() * (((i % n) / c) + 1));
        currentSize = reader.getPageSize(p);
        factor = Math.min(unitSize.width() / currentSize.width(), unitSize.height() / currentSize.height());
        offsetX += (unitSize.width() - (currentSize.width() * factor)) / 2f;
        offsetY += (unitSize.height() - (currentSize.height() * factor)) / 2f;
        page = writer.getImportedPage(reader, p);
        cb.addTemplate(page, factor, 0, 0, factor, offsetX, offsetY);
      }
View Full Code Here

        offsetX = unitSize.width() * ((i % n) % c);
        offsetY = newSize.height() - (unitSize.height() * (((i % n) / c) + 1));
        currentSize = reader.getPageSize(p);
        factor = Math.min(unitSize.width() / currentSize.width(), unitSize.height() / currentSize.height());
        offsetX += (unitSize.width() - (currentSize.width() * factor)) / 2f;
        offsetY += (unitSize.height() - (currentSize.height() * factor)) / 2f;
        page = writer.getImportedPage(reader, p);
        cb.addTemplate(page, factor, 0, 0, factor, offsetX, offsetY);
      }
      // step 5: we close the document
      document.close();
View Full Code Here

          (File) getValue("destfile")));
      float txtwidth = bf.getWidthPoint(text, fontsize);
      for (int i = 1; i <= pagecount; i++) {
        PdfContentByte seitex = stamp.getOverContent(i);
        Rectangle recc = reader.getCropBox(i);
        float winkel = (float) Math.atan(recc.height() / recc.width());
        float m1 = (float) Math.cos(winkel);
        float m2 = (float) - Math.sin(winkel);
        float m3 = (float) Math.sin(winkel);
        float m4 = (float) Math.cos(winkel);
        float xoff = (float) ( -Math.cos(winkel) * txtwidth / 2 - Math
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.