org.apache.pdfbox.pdmodel.interactive.annotation
public class: PDAnnotationTextMarkup [javadoc |
source]
java.lang.Object
org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation
org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup
org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationTextMarkup
All Implemented Interfaces:
COSObjectable
This is the abstract class that represents a text markup annotation
Introduced in PDF 1.3 specification, except Squiggly lines in 1.4.
- author:
Paul
- King
- version:
$
- Revision: 1.1 $
Field Summary |
---|
public static final String | SUB_TYPE_HIGHLIGHT | The types of annotation. |
public static final String | SUB_TYPE_UNDERLINE | The types of annotation. |
public static final String | SUB_TYPE_SQUIGGLY | The types of annotation. |
public static final String | SUB_TYPE_STRIKEOUT | The types of annotation. |
Constructor: |
public PDAnnotationTextMarkup(String subType) {
super();
setSubtype( subType );
// Quad points are required, set and empty array
setQuadPoints( new float[0] );
}
Creates a TextMarkup annotation of the specified sub type. Parameters:
subType - the subtype the annotation represents
|
public PDAnnotationTextMarkup(COSDictionary field) {
super( field );
}
Creates a TextMarkup annotation from a COSDictionary, expected to be a
correct object definition. Parameters:
field - the PDF objet to represent as a field.
|
Methods from org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup: |
---|
getConstantOpacity, getCreationDate, getExternalData, getInReplyTo, getIntent, getPopup, getReplyType, getRichContents, getSubject, getTitlePopup, setConstantOpacity, setCreationDate, setExternalData, setInReplyTo, setIntent, setPopup, setReplyType, setRichContents, setSubject, setTitlePopup |
Methods from org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation: |
---|
createAnnotation, getAnnotationFlags, getAnnotationName, getAppearance, getAppearanceStream, getCOSObject, getColour, getContents, getDictionary, getModifiedDate, getPage, getRectangle, getSubtype, isHidden, isInvisible, isLocked, isNoRotate, isNoView, isNoZoom, isPrinted, isReadOnly, isToggleNoView, setAnnotationFlags, setAnnotationName, setAppearance, setAppearanceStream, setColour, setContents, setHidden, setInvisible, setLocked, setModifiedDate, setNoRotate, setNoView, setNoZoom, setPrinted, setReadOnly, setRectangle, setToggleNoView |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationTextMarkup Detail: |
public float[] getQuadPoints() {
COSArray quadPoints = (COSArray) getDictionary().getDictionaryObject( "QuadPoints" );
if (quadPoints != null)
{
return quadPoints.toFloatArray();
}
else
{
return null; // Should never happen as this is a required item
}
}
This will retrieve the set of quadpoints which encompass the areas of
this annotation. |
public String getSubtype() {
return getDictionary().getNameAsString( COSName.SUBTYPE);
}
This will retrieve the sub type (and hence appearance, AP taking precedence)
For this annotation. |
public void setQuadPoints(float[] quadPoints) {
COSArray newQuadPoints = new COSArray();
newQuadPoints.setFloatArray( quadPoints );
getDictionary().setItem( "QuadPoints", newQuadPoints );
}
This will set the set of quadpoints which encompass the areas of this
annotation. |
public void setSubtype(String subType) {
getDictionary().setName( COSName.SUBTYPE, subType );
}
This will set the sub type (and hence appearance, AP taking precedence) For
this annotation. See the SUB_TYPE_XXX constants for valid values. |