org.faceless.pdf2
Class AnnotationMarkup

java.lang.Object
  extended by org.faceless.pdf2.PDFAnnotation
      extended by org.faceless.pdf2.AnnotationMarkup
All Implemented Interfaces:
Cloneable

public class AnnotationMarkup
extends PDFAnnotation

This class represents the type of PDFAnnotation created by the "Text Edit" option in Acrobat 6. There are several different subtypes of this annotation - "Highlight", "Underline", "Squiggly" or "StrikeOut", all of which can be determined by the crossed-out or underlined text in the PDF.

Since:
2.3.6

Constructor Summary
AnnotationMarkup(String type)
          Create a new Markup Annotation.
 
Method Summary
protected  Object clone()
           
 boolean equals(Object o)
           
 float[] getCorners()
          Return the four corners of the text underlying the annotation
 String getType()
          Return the type of Markup Annotation - "Highlight", "Squiggly", "Underline" or "Strikeout".
 void setCorners(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
          Set the four corners (x1,y1) (x2,y2) (x3,y3) (x4,y4) of the quadrilateral that encompasses the text underlying this annotation, specified counter-clockwise.
 void setRectangle(float x1, float y1, float x2, float y2)
          Set the rectangle for the annotation - where it is on the page.
 String toString()
           
 
Methods inherited from class org.faceless.pdf2.PDFAnnotation
addReview, getAuthor, getColor, getContents, getCreationDate, getFlag, getInReplyTo, getModifyDate, getOpacity, getPage, getPopup, getRectangle, getReplies, getReviews, getSubject, getUniqueID, isPrintable, isReadOnly, isVisible, setAuthor, setColor, setContents, setCreationDate, setFlag, setInReplyTo, setModifyDate, setOpacity, setPage, setPrintable, setReadOnly, setRebuildRequired, setSubject, setUniqueID, setVisible, touch
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnnotationMarkup

public AnnotationMarkup(String type)
Create a new Markup Annotation. The type of markup must be specified, and may be one of:

Parameters:
type - the type of Markup Annotation
Method Detail

getType

public String getType()
Return the type of Markup Annotation - "Highlight", "Squiggly", "Underline" or "Strikeout". Note it's possible that future releases of Acrobat might add to this list.

Overrides:
getType in class PDFAnnotation
Returns:
the type of Markup annotation

setCorners

public void setCorners(float x1,
                       float y1,
                       float x2,
                       float y2,
                       float x3,
                       float y3,
                       float x4,
                       float y4)
Set the four corners (x1,y1) (x2,y2) (x3,y3) (x4,y4) of the quadrilateral that encompasses the text underlying this annotation, specified counter-clockwise. The text the annotation is supposed to be highlighting is assumed to run from (x1,y1) to (x2,y2).

Parameters:
x1 - the X co-ordinate of the bottom-left corner of the text
y1 - the Y co-ordinate of the bottom-left corner of the text
x2 - the X co-ordinate of the bottom-right corner of the text
y2 - the Y co-ordinate of the bottom-right corner of the text
x3 - the X co-ordinate of the top-left corner of the text
y3 - the Y co-ordinate of the top-left corner of the text
x4 - the X co-ordinate of the top-right corner of the text
y4 - the Y co-ordinate of the top-right corner of the text

setRectangle

public void setRectangle(float x1,
                         float y1,
                         float x2,
                         float y2)
Description copied from class: PDFAnnotation
Set the rectangle for the annotation - where it is on the page. Every annotation must have a rectangle set - if it's not set when the document is written, it's forced to (0,0,0,0).

Note that all co-ordinates are in absolute page co-ordinates. This means they are measured in points from the bottom-left hand corner of the page, regardless of any calls to PDFPage.rotate(float, float, double) or PDFPage.setUnits(float, int) that have been made. This restriction is part of the PDF specification.

Overrides:
setRectangle in class PDFAnnotation
Parameters:
x1 - the X co-ordinate of the bottom-left corner of the rectangle
y1 - the Y co-ordinate of the bottom-left corner of the rectangle
x2 - the X co-ordinate of the top-right corner of the rectangle
y2 - the Y co-ordinate of the top-right corner of the rectangle

getCorners

public float[] getCorners()
Return the four corners of the text underlying the annotation

Returns:
an array of 8 points as set by setCorners()

toString

public String toString()

equals

public boolean equals(Object o)
Overrides:
equals in class Object

clone

protected Object clone()
Overrides:
clone in class Object


Copyright © 2001-2008 Big Faceless Organization