Package com.lowagie.text

Examples of com.lowagie.text.Image


        if (getTop() < bottom) {
            return new ArrayList();
        }
        top = Math.min(getTop(), top);
        // initializations
        Image image;
        float height;
        ArrayList result = new ArrayList();
        // we loop over the images
        for (Iterator i = images.iterator(); i.hasNext() && !header;) {
            image = (Image) i.next();
            height = image.getAbsoluteY();
            // if the currentPosition is higher than the bottom, we add the line to the result
            if (top - height > (bottom + cellpadding)) {
                image.setAbsolutePosition(image.getAbsoluteX(), top - height);
                result.add(image);
                i.remove();
            }
        }
        return result;
View Full Code Here


     */

    public float remainingHeight() {
        float result = 0f;
        for (Iterator i = images.iterator(); i.hasNext();) {
            Image image = (Image) i.next();
            result += image.getScaledHeight();
        }
        return remainingLinesHeight() + cellspacing + 2 * cellpadding + result;
    }
View Full Code Here

                    PdfName rname = new PdfName("img" + images.size());
                    images.put(image.getMySerialId(), rname);
                    imageDictionary.put(rname, dref);
                    return rname;
                }
                Image maskImage = image.getImageMask();
                PdfIndirectReference maskRef = null;
                if (maskImage != null) {
                    PdfName mname = (PdfName)images.get(maskImage.getMySerialId());
                    maskRef = getImageReference(mname);
                }
                PdfImage i = new PdfImage(image, "img" + images.size(), maskRef);
                if (image instanceof ImgJBIG2) {
                    byte[] globals = ((ImgJBIG2) image).getGlobalBytes();
View Full Code Here

                        if (hs != null)
                            hScale = hs.floatValue();
                        text.setTextMatrix(hScale, b, c, 1, xMarker, yMarker);
                    }
                    if (chunk.isImage()) {
                        Image image = chunk.getImage();
                        float matrix[] = image.matrix();
                        matrix[Image.CX] = xMarker + chunk.getImageOffsetX() - matrix[Image.CX];
                        matrix[Image.CY] = yMarker + chunk.getImageOffsetY() - matrix[Image.CY];
                        graphics.addImage(image, matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);
                        text.moveText(xMarker + lastBaseFactor + image.getScaledWidth() - text.getXTLM(), 0);
                    }
                }
                xMarker += width;
                ++chunkStrokeIdx;
            }
View Full Code Here

            ctx.cellGraphics.rectangle(cell.rectangle(indentTop(), indentBottom()));
            // we write the text of the cell
            ArrayList images = cell.getImages(indentTop(), indentBottom());
            for (Iterator im = images.iterator(); im.hasNext();) {
              cellsShown = true;
              Image image = (Image) im.next();
              graphics.addImage(image);
            }
            lines = cell.getLines(indentTop(), indentBottom());
            float cellTop = cell.getTop(indentTop());
            text.moveText(0, cellTop-heightCorrection);
View Full Code Here

                }

                // and additional graphics
                ArrayList images = cell.getImages(ctx.pagetop, indentBottom());
                for (Iterator i = images.iterator(); i.hasNext();) {
                    Image image = (Image) i.next();
                    graphics.addImage(image);
                }

            }
        }
View Full Code Here

                    content.append("\nEI\nQ").append_i(separator);
                }
                else {
                    PdfName name;
                    PageResources prs = getPageResources();
                    Image maskImage = image.getImageMask();
                    if (maskImage != null) {
                        name = writer.addDirectImageSimple(maskImage);
                        prs.addXObject(name, writer.getImageReference(name));
                    }
                    name = writer.addDirectImageSimple(image);
View Full Code Here

   * @return  the height of the cell
   * @since  3.0.0
   */
  public float getMaxHeight() {
    boolean pivoted = (getRotation() == 90 || getRotation() == 270);
    Image img = getImage();
    if (img != null) {
      img.scalePercent(100);
      float refWidth = pivoted ? img.getScaledHeight() : img.getScaledWidth();
      float scale = (getRight() - getEffectivePaddingRight()
                    - getEffectivePaddingLeft() - getLeft()) / refWidth;
      img.scalePercent(scale * 100);
      float refHeight = pivoted ? img.getScaledWidth() : img.getScaledHeight();
      setBottom(getTop() - getEffectivePaddingTop() - getEffectivePaddingBottom() - refHeight);
    }
    else {
      if (pivoted && hasFixedHeight())
        setBottom(getTop() - getFixedHeight());
View Full Code Here

            int flags = 0;
            if (ff != null)
                flags = ff.intValue();
            if ((flags & PdfFormField.FF_PUSHBUTTON) != 0) {
                //we'll assume that the value is an image in base64
                Image img;
                try {
                    img = Image.getInstance(Base64.decode(value));
                }
                catch (Exception e) {
                    return false;
View Full Code Here

        continue;
      float currentMaxHeight = maxHeight + extraHeights[k];
     
      writeBorderAndBackground(xPos, yPos, currentMaxHeight, cell, canvases);

      Image img = cell.getImage();
     
      float tly = cell.getTop() + yPos - cell.getEffectivePaddingTop();
      if (cell.getHeight() <= currentMaxHeight) {
        switch (cell.getVerticalAlignment()) {
        case Element.ALIGN_BOTTOM:
          tly = cell.getTop() + yPos - currentMaxHeight + cell.getHeight()
              - cell.getEffectivePaddingTop();
          break;
        case Element.ALIGN_MIDDLE:
          tly = cell.getTop() + yPos + (cell.getHeight() - currentMaxHeight) / 2
              - cell.getEffectivePaddingTop();
          break;
        default:
          break;
        }
      }
      if (img != null) {
                if (cell.getRotation() != 0) {
                    img = Image.getInstance(img);
                    img.setRotation(img.getImageRotation() + (float)(cell.getRotation() * Math.PI / 180.0));
                }
        boolean vf = false;
        if (cell.getHeight() > currentMaxHeight) {
          img.scalePercent(100);
          float scale = (currentMaxHeight - cell.getEffectivePaddingTop() - cell
              .getEffectivePaddingBottom())
              / img.getScaledHeight();
          img.scalePercent(scale * 100);
          vf = true;
        }
        float left = cell.getLeft() + xPos
            + cell.getEffectivePaddingLeft();
        if (vf) {
          switch (cell.getHorizontalAlignment()) {
          case Element.ALIGN_CENTER:
            left = xPos
                + (cell.getLeft() + cell.getEffectivePaddingLeft()
                    + cell.getRight()
                    - cell.getEffectivePaddingRight() - img
                    .getScaledWidth()) / 2;
            break;
          case Element.ALIGN_RIGHT:
            left = xPos + cell.getRight()
                - cell.getEffectivePaddingRight()
                - img.getScaledWidth();
            break;
          default:
            break;
          }
          tly = cell.getTop() + yPos - cell.getEffectivePaddingTop();
        }
        img.setAbsolutePosition(left, tly - img.getScaledHeight());
        try {
          canvases[PdfPTable.TEXTCANVAS].addImage(img);
        } catch (DocumentException e) {
          throw new ExceptionConverter(e);
        }
View Full Code Here

TOP

Related Classes of com.lowagie.text.Image

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.