
108
8
Creating Annotations
This chapter explains how to create new annotations and modify existing ones. Annotations are tools that
let you electronically collaborate within Adobe Reader or Acrobat, similar to the way people traditionally
collaborate using paper by adding comments, highlights, sticky notes, and so on. For example, the note
annotation enables Adobe Reader or Acrobat users to add notes within a PDF document that other
viewers can read.
This chapter contains the following information.
About annotations
The Acrobat core API provides methods for working with annotations in PDF documents. Annotations are
represented by a
PDAnnot
typedef, which is the abstract superclass for all annotations.
Several annotation types exist, which are identified by their subtype. Each subtype can have additional
properties that extend the basic ones. The subtype for text annotations (also called notes) is text. The
subtype for link annotations is link. The Acrobat core API contains two built-in annotation typedefs
PDTextAnnot
and
PDLinkAnnot
. A
PDTextAnnot
object corresponds to a text annotation and a
PDLinkAnnot
object corresponds to a link annotation.
You can use
PDAnnot
methods to get and set various annotation properties, such as color, date, title, location,
and subtype. For example, you can invoke the
PDAnnotSetColor
method to set the color of an annotation.
Note:
This chapter does not discuss how to create 3D annotations. For information, see
“Creating 3D
Annotations” on page 203
.
Creating text annotations
You can create a text annotation by performing the following tasks:
1. Create a rectangle region that specifies the annotation’s location. To create a rectangle region, create
an
ASFixedRect
object.
2. Define the rectangle’s borders by setting the
ASFixedRect
object’s left, top, right, and bottom attributes.
3. Create an
ASPage
object that represents the page that will contain the new annotation by invoking
the
PDDocAcquirePage
method. This method requires a
PDDoc
object and the
ASInt32
object that
represents the page number. This method returns an
ASPage
object.
Topic
Description
See
About annotations
Describes the characteristics of annotations.
page 108
Creating text annotations
Describes how to create text annotations.
page 108
Retrieving existing annotations
Describes how to retrieve existing text annotations.
page 110
Modifying text annotations
Describes how to modify existing annotations.
page 111