Package com.lowagie.text

Examples of com.lowagie.text.Annotation


            rectangle(image);
            restoreState();
         }
         if (image.getLayer() != null)
            endLayer();
         Annotation annot = image.getAnnotation();
         if (annot == null)
            return;
         float[] r = new float[unitRect.length];
         for (int k = 0; k < unitRect.length; k += 2)
         {
            r[k] = a * unitRect[k] + c * unitRect[k + 1] + e;
            r[k + 1] = b * unitRect[k] + d * unitRect[k + 1] + f;
         }
         float llx = r[0];
         float lly = r[1];
         float urx = llx;
         float ury = lly;
         for (int k = 2; k < r.length; k += 2)
         {
            llx = Math.min(llx, r[k]);
            lly = Math.min(lly, r[k + 1]);
            urx = Math.max(urx, r[k]);
            ury = Math.max(ury, r[k + 1]);
         }
         annot = new Annotation(annot);
         annot.setDimensions(llx, lly, urx, ury);
         PdfAnnotation an = PdfAnnotationsImp.convertAnnotation(writer, annot, new LwgRectangle(llx, lly, urx, ury));
         if (an == null)
            return;
         addAnnotation(an);
      }
View Full Code Here


                writeEnd(HtmlTags.TABLE);
                return;
            }
            case Element.ANNOTATION:
            {
                Annotation annotation = (Annotation) element;
                writeComment(annotation.title() + ": " + annotation.content());
                return;
            }
            case Element.IMGRAW:
            case Element.JPEG:
            case Element.JPEG2000:
View Full Code Here

            }
        }

        // annotations
        if (ElementTags.ANNOTATION.equals(name)) {
            Annotation annotation = ElementFactory.getAnnotation(attributes);
            TextElementArray current;
            try {
                try {
                    current = (TextElementArray) stack.pop();
                    try {
View Full Code Here

            Stack newStack = new Stack();
            while (!(current instanceof Chapter
                    || current instanceof Section || current instanceof Cell)) {
                newStack.push(current);
                if (current instanceof Anchor) {
                    img.setAnnotation(new Annotation(0, 0, 0,
                            0, ((Anchor) current).getReference()));
                }
                current = stack.pop();
            }
            ((TextElementArray) current).add(img);
View Full Code Here

    }

    String title = attributes.getProperty(ElementTags.TITLE);
    String text = attributes.getProperty(ElementTags.CONTENT);
    if (title != null || text != null) {
      return new Annotation(title, text, llx, lly, urx, ury);
    }
    value = attributes.getProperty(ElementTags.URL);
    if (value != null) {
      return new Annotation(llx, lly, urx, ury, value);
    }
    value = attributes.getProperty(ElementTags.NAMED);
    if (value != null) {
      return new Annotation(llx, lly, urx, ury, Integer.parseInt(value));
    }
    String file = attributes.getProperty(ElementTags.FILE);
    String destination = attributes.getProperty(ElementTags.DESTINATION);
    String page = (String) attributes.remove(ElementTags.PAGE);
    if (file != null) {
      if (destination != null) {
        return new Annotation(llx, lly, urx, ury, file, destination);
      }
      if (page != null) {
        return new Annotation(llx, lly, urx, ury, file, Integer
            .parseInt(page));
      }
    }
    return new Annotation("", "", llx, lly, urx, ury);
  }
View Full Code Here

                }
                case Element.ANNOTATION: {
                    if (line == null) {
                        carriageReturn();
                    }
                    Annotation annot = (Annotation) element;
                    Rectangle rect = new Rectangle(0, 0);
                    if (line != null)
                      rect = new Rectangle(annot.llx(indentRight() - line.widthLeft()), annot.lly(indentTop() - currentHeight), annot.urx(indentRight() - line.widthLeft() + 20), annot.ury(indentTop() - currentHeight - 20));
                    PdfAnnotation an = PdfAnnotationsImp.convertAnnotation(writer, annot, rect);
                    annotationsImp.addPlainAnnotation(an);
                    pageEmpty = false;
                    break;
                }
View Full Code Here

                rectangle(image);
                restoreState();
            }
            if (image.getLayer() != null)
                endLayer();
            Annotation annot = image.getAnnotation();
            if (annot == null)
                return;
            float[] r = new float[unitRect.length];
            for (int k = 0; k < unitRect.length; k += 2) {
                r[k] = a * unitRect[k] + c * unitRect[k + 1] + e;
                r[k + 1] = b * unitRect[k] + d * unitRect[k + 1] + f;
            }
            float llx = r[0];
            float lly = r[1];
            float urx = llx;
            float ury = lly;
            for (int k = 2; k < r.length; k += 2) {
                llx = Math.min(llx, r[k]);
                lly = Math.min(lly, r[k + 1]);
                urx = Math.max(urx, r[k]);
                ury = Math.max(ury, r[k + 1]);
            }
            annot = new Annotation(annot);
            annot.setDimensions(llx, lly, urx, ury);
            PdfAnnotation an = PdfAnnotationsImp.convertAnnotation(writer, annot, new Rectangle(llx, lly, urx, ury));
            if (an == null)
                return;
            addAnnotation(an);
        }
View Full Code Here

                rectangle(image);
                restoreState();
            }
            if (image.getLayer() != null)
                endLayer();
            Annotation annot = image.getAnnotation();
            if (annot == null)
                return;
            float[] r = new float[unitRect.length];
            for (int k = 0; k < unitRect.length; k += 2) {
                r[k] = a * unitRect[k] + c * unitRect[k + 1] + e;
                r[k + 1] = b * unitRect[k] + d * unitRect[k + 1] + f;
            }
            float llx = r[0];
            float lly = r[1];
            float urx = llx;
            float ury = lly;
            for (int k = 2; k < r.length; k += 2) {
                llx = Math.min(llx, r[k]);
                lly = Math.min(lly, r[k + 1]);
                urx = Math.max(urx, r[k]);
                ury = Math.max(ury, r[k + 1]);
            }
            annot = new Annotation(annot);
            annot.setDimensions(llx, lly, urx, ury);
            PdfAnnotation an = PdfAnnotationsImp.convertAnnotation(writer, annot, new Rectangle(llx, lly, urx, ury));
            if (an == null)
                return;
            addAnnotation(an);
        }
View Full Code Here

            }
        }

        // annotations
        if (ElementTags.ANNOTATION.equals(name)) {
            Annotation annotation = ElementFactory.getAnnotation(attributes);
            TextElementArray current;
            try {
                try {
                    current = (TextElementArray) stack.pop();
                    try {
View Full Code Here

            Stack newStack = new Stack();
            while (!(current instanceof Chapter
                    || current instanceof Section || current instanceof Cell)) {
                newStack.push(current);
                if (current instanceof Anchor) {
                    img.setAnnotation(new Annotation(0, 0, 0,
                            0, ((Anchor) current).getReference()));
                }
                current = stack.pop();
            }
            ((TextElementArray) current).add(img);
View Full Code Here

TOP

Related Classes of com.lowagie.text.Annotation

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.