com.snowtide.pdf.annot
Interface Annotation

All Known Implementing Classes:
com.snowtide.pdf.annot.BaseAnnotation, FreeTextAnnotation, LinkAnnotation, TextAnnotation

public interface Annotation

The common interface implemented by all PDF annotation classes.

All PDF annotations define a range of base attributes, which are accessible using the functions this inteface specifies. It should be noted that none of the attributes that are potentially available through the functions defined in this interface are required to be present for any particular annotation type.

Different types of annotations also carry specialized attributes; PDFTextStream currently supports richer access to these annotation types:

Annotation types not listed above (which are primarily graphical in nature) are represented by PDFTextStream using a basic Annotation implementation that allows access to such annotations' textual attributes.

Since:
v1.3.5
Version:
©2004-2012 Snowtide Informatics Systems, Inc.

Method Summary
 java.lang.String getContents()
          Returns the text content of this annotation.
 java.lang.String getModificationDate()
          Returns the date, in PDF date format, when this annotation was last modified.
 java.lang.String getName()
          Returns the optional name for this annotation, which should uniquely identify it within a page.
 int getPageNumber()
          Returns the page with which this annotation is associated.
 Rectangle getRect()
          Returns the bounding rectangle where this annotation is located on its page.
 java.lang.String getTypeCd()
          Returns a String indicating what type of annotation this this.
 

Method Detail

getContents

java.lang.String getContents()
Returns the text content of this annotation. Some annotation types do not encode any text content; in such cases, those annotation type implementations will either return null from this function, or return an alternative descriptive text string that may be used to indicate the value or nature of this annotation for disabled users.


getPageNumber

int getPageNumber()
Returns the page with which this annotation is associated. This page number is 0-indexed, and may be used to retrieve a Page object representing the page's content using the PDFTextStream.getPage(int) function.


getRect

Rectangle getRect()
Returns the bounding rectangle where this annotation is located on its page.


getName

java.lang.String getName()
Returns the optional name for this annotation, which should uniquely identify it within a page.


getModificationDate

java.lang.String getModificationDate()
Returns the date, in PDF date format, when this annotation was last modified. This date string may be parsed using the PDFDateParser class. This function may return null if no modification date is present in the annotation data.


getTypeCd

java.lang.String getTypeCd()
Returns a String indicating what type of annotation this this. These types are defined in Section 8.4.5 of the PDF Format Reference, and are returned with a leading forward slash.