DL Logo

PDAnnot Definitions

CastToPDAnnot

Header: PDExpT.h:431

Description

Casts a link annotation or a text annotation to a generic annotation.

Syntax

#define CastToPDAnnot ( a ) *( PDAnnot *) &( a )

Parameters

a
The link annotation or text annotation to cast.

PDAnnotIgnorePerms

Header: PDExpT.h:469

Description

Allows modifying this annotation type in a write-protected document.

Syntax

#define PDAnnotIgnorePerms 0x0008

PDAnnotInfoInit

Header: PDExpT.h:517

Syntax

#define PDAnnotInfoInit ( x )

PDAnnotMaxDashes

Header: PDExpT.h:1026

Syntax

#define PDAnnotMaxDashes 10

PDAnnotOperationAll

Header: PDExpT.h:479

Description

All operations are allowed.

Syntax

#define PDAnnotOperationAll 0xFFFF

PDAnnotOperationFilter

Header: PDExpT.h:459

Description

It is okay to filter annotations.

Syntax

#define PDAnnotOperationFilter 0x0002

PDAnnotOperationFlatten

Header: PDExpT.h:474

Description

When creating a flattened page include this annot

Syntax

#define PDAnnotOperationFlatten 0x0010

PDAnnotOperationManager

Header: PDExpT.h:464

Description

It is okay to manage annotations.

Syntax

#define PDAnnotOperationManager 0x0004

PDAnnotOperationSummarize

Header: PDExpT.h:454

Description

It is okay to summarize annotations.

Syntax

#define PDAnnotOperationSummarize 0x0001

pdAnnotHidden

Header: PDExpT.h:376

Description

The annotation is not visible and does not print.

Syntax

#define pdAnnotHidden 0x02

pdAnnotInvisible

Header: PDExpT.h:371

Description

If there is no annotation handler, the annotation is invisible.

Syntax

#define pdAnnotInvisible 0x01

pdAnnotLock

Header: PDExpT.h:407

Description

The annotation does not move or resize with the view. Currently only form fields respect this flag. If the annotation is locked, the user cannot delete, move or change its associated form field's properties.

Syntax

#define pdAnnotLock 0x80

pdAnnotLockContents

Header: PDExpT.h:417

Description

If the annotation is content-locked, the user can not change its content key.

Syntax

#define pdAnnotLockContents 0x200

pdAnnotNoRotate

Header: PDExpT.h:391

Description

The annotation does not rotate with the page.

Syntax

#define pdAnnotNoRotate 0x10

pdAnnotNoView

Header: PDExpT.h:396

Description

The annotation does not view but can print.

Syntax

#define pdAnnotNoView 0x20

pdAnnotNoZoom

Header: PDExpT.h:386

Description

The annotation does not zoom with the view.

Syntax

#define pdAnnotNoZoom 0x08

pdAnnotPrint

Header: PDExpT.h:381

Description

The annotation prints.

Syntax

#define pdAnnotPrint 0x04

pdAnnotReadOnly

Header: PDExpT.h:401

Description

The annotation does not interact with the user.

Syntax

#define pdAnnotReadOnly 0x40

pdAnnotSequenceAdjust

Header: PDExpT.h:422

Description

A place holder used only at runtime. Do not set this bit in PDF/FDF files.

Syntax

#define pdAnnotSequenceAdjust 0x80000000

pdAnnotToggleNoView

Header: PDExpT.h:412

Description

A mouse-over or selection causes the noView bit to toggle.

Syntax

#define pdAnnotToggleNoView 0x100

PDAnnot Enumerations

PDAnnotPrintOps

Header: PDExpT.h:556

Description

PDAnnotPrintOp is passed to the PDAnnotHandlerGetPrintAppearanceProc() callback to specify the type of print operation being performed.

Enum Constants

kPDAnnotPrintStandard=1
A standard print operation.
kPDAnnotPrintVariableData
The user selected Form Fields Only.

PDAnnot Typedefs

PDAnnot

Header: PDExpT.h:323

Description

An annotation on a page in a PDF file. Acrobat viewers have two built-in annotation types: PDTextAnnot and PDLinkAnnot. Physical attributes of the annotation can be set and queried. Plug-ins add movie and Widget (form field) annotations. Developers can define new annotation subtypes by creating new annotation handlers.

Related Methods

Syntax

typedef OPAQUE_64_BITS PDAnnot;

Returned From

Used By

Used In

PDAnnotClipboardData

Header: PDExpT.h:545

Description

Used to store PDAnnot data for copy and paste operations.

Syntax

typedef struct _t_PDAnnotClipboardData *PDAnnotClipboardData;

Returned From

Used By

PDAnnotPrintOp

Header: PDExpT.h:564

Description

PDAnnotPrintOp is passed to the PDAnnotHandlerGetPrintAppearanceProc() callback to specify the type of print operation being performed.

For value options see PDAnnotPrintOps.

Syntax

typedef ASEnum16 PDAnnotPrintOp;

Used By

PDAnnot Callback Signatures

PDAnnotWillPrintProc

Header: PDExpT.h:661

Description

A callback for PDAnnotHandler. This method is called to determine whether an annotation is printed.

Syntax

ASBool PDAnnotWillPrintProc(PDAnnotHandler pdanh, PDAnnot annot);

Parameters

pdanh
The annotation handler of the annotation type to print.
annot
The annotation to print.

Returns

true if the annotation is printed, false if the annotation is not printed.

Used In

PDAnnot Structures

_PDAnnotInfoRec

Header: PDExpT.h:487

Description

Information associated with an annotation.

Syntax

struct _PDAnnotInfoRec {
ASSize_t size;
The size of the data structure. It must be set to sizeof(PDAnnotInfoRec).
ASFlagBits nOperationFlags;
The allowed operations.
unsigned char *cAuthor;
The author of this annotation.
unsigned char *cContents;
The associated text for this annotation.
unsigned char *cDate;
The modification date of this annotation.
ASFixed fxLayer;
The layer of this annotation.
} PDAnnotInfoRec, *PDAnnotInfo;

Used By

PDAnnot Functions

PDAnnotCanCopy

Header: PDProcs.h:10943

Description

Tests whether the data from an annotation on a given page can be copied to a clipboard for pasting. This depends on whether there is a PDAnnotHandler with copy and paste support for the annotation, and whether copying is allowed by document permissions.

Syntax

ASBool PDAnnotCanCopy(PDPage sourcePage, PDAnnot annot);

Parameters

sourcePage
The page containing the annotation to test. It can be NULL (as when copying annotations while spawning a hidden template).
annot
The annotation to test.

Returns

true if the annotation object can be copied, false otherwise.

PDAnnotCanPaste

Header: PDProcs.h:10981

Description

Tests whether data from an annotation that has been copied to a clipboard can be pasted to a location on a page. Pasting can be disallowed by document permissions, or because the annotation cannot be accurately reproduced in the destination document.

Syntax

ASBool PDAnnotCanPaste(PDPage destPage, const ASFixedPoint *center, PDAnnotClipboardData data);

Parameters

destPage
The page to which the annotation would be pasted.
center
The location for the center of the annotation on the destination page, or a NULL pointer to center the annotation on the destination page.
data
The copied annotation data to test.

Returns

true if the annotation data can be pasted, false otherwise.

PDAnnotCopy

Header: PDProcs.h:10959

Description

Copies action object data to a clipboard structure, from which it can be pasted.

Syntax

PDAnnotClipboardData PDAnnotCopy(PDPage sourcePage, PDAnnot annot);

Parameters

sourcePage
The page containing the annotation to copy. It can be NULL (as when copying annotations while spawning a hidden template).
annot
The annotation to copy.

Returns

The annotation clipboard data object.

PDAnnotDestroyClipboardData

Header: PDProcs.h:11016

Description

Destroys data that has been copied from an annotation object into a clipboard. Use this method after successfully pasting the data to a new document.

Syntax

void PDAnnotDestroyClipboardData(PDAnnotClipboardData data);

Parameters

data
The clipboard annotation data to destroy.

PDAnnotEqual

Header: PDProcs.h:393

Description

Tests whether two annotations are identical.

Related Methods

Syntax

ASBool PDAnnotEqual(PDAnnot anAnnot, PDAnnot annot2);

Parameters

anAnnot
The first annotation to compare.
annot2
The second annotation to compare.

Returns

true if the annotations are equal, false otherwise. Two annotations are equal only if their Cos objects are equal (see CosObjEqual()).

Exceptions

PDAnnotFromCosObj

Header: PDProcs.h:566

Description

Converts a dictionary Cos object to an annotation. This method does not copy the object, but is instead the logical equivalent of a type cast.

Related Methods

Syntax

PDAnnot PDAnnotFromCosObj(CosObj obj);

Parameters

obj
The dictionary Cos object whose annotation is obtained.

Returns

The PDAnnot corresponding to the Cos object.

Exceptions

is raised if the annotation is invalid, as determined by PDAnnotIsValid().

PDAnnotGetColor

Header: PDProcs.h:423

Description

Gets a note or link annotation's color. If the annotation does not specify an explicit color, a default color is returned. Text annotations return default yellow; all others return black. Only RGB color specifications are currently supported.

Syntax

ASBool PDAnnotGetColor(PDAnnot anAnnot, PDColorValue color);

Parameters

anAnnot
The note or link annotation whose color is obtained.
color
(Filled by the method) The annotation's color, which is used as follows:
Annotation
Use
Closed text note
The icon background color.
Open, un-selected text note
The bounding rectangle color.
Open, selected text note
The color of the annotation's title bar.
Link annotation
The link border color.

Returns

true if the annotation specifies an explicit color, false if a default color was used.

PDAnnotGetCosObj

Header: PDProcs.h:552

Description

Gets the Cos object corresponding to an annotation. This method does not copy the object, but is instead the logical equivalent of a type cast.

Related Methods

Syntax

CosObj PDAnnotGetCosObj(PDAnnot annot);

Parameters

annot
IN/OUT The annotation whose Cos object is obtained.

Returns

The dictionary Cos object for the annotation. The contents of the dictionary can be enumerated using CosObjEnum(). It returns a NULL Cos object if the annotation is not valid, as determined by PDAnnotIsValid().

PDAnnotGetDate

Header: PDProcs.h:522

Description

Gets an annotation's date.

Syntax

ASBool PDAnnotGetDate(PDAnnot anAnnot, ASTimeRecP date);

Parameters

anAnnot
The annotation whose date is obtained.
date
(Filled by the method) The annotation's time and date.

Returns

true if the annotation contains a date key and the value of that key can be successfully parsed as a date string, false otherwise.

Exceptions

is raised if the annotation is not valid or if the value of the annotation's M (ModDate) key is not a string.
is raised if date is NULL.

PDAnnotGetFlags

Header: PDProcs.h:718

Description

Gets an annotation's flags.

Syntax

ASUns32 PDAnnotGetFlags(PDAnnot anAnnot);

Parameters

anAnnot
IN/OUT The annotation whose flags are obtained.

Returns

The flags, or 0 if the annotation does not have a flags key.

PDAnnotGetOCMD

Header: PDProcs.h:9390

Description

Gets an optional-content membership dictionary (OCMD) object associated with the annotation.

Syntax

PDOCMD PDAnnotGetOCMD(PDAnnot annot);

Parameters

annot
The annotation from which the dictionary is obtained.

Returns

The dictionary object, or NULL if the annotation does not contain a dictionary.

PDAnnotGetRect

Header: PDProcs.h:361

Description

Gets the size and location of an annotation on its page.

Syntax

void PDAnnotGetRect(PDAnnot anAnnot, ASFixedRect *boxP);

Parameters

anAnnot
IN/OUT The annotation whose location and size are set.
boxP
IN/OUT (Filled by the method) A pointer to a rectangle that specifies the annotation's bounding rectangle, specified in user space coordinates.

Exceptions

PDAnnotGetSubtype

Header: PDProcs.h:343

Description

Gets an annotation's subtype.

Syntax

ASAtom PDAnnotGetSubtype(PDAnnot anAnnot);

Parameters

anAnnot
The annotation whose subtype is obtained.

Returns

The ASAtom for the annotation's subtype. This can be converted to a string using ASAtomGetString(). The storage pointed to by the return value is owned by the Acrobat viewer and should be assumed to be valid only until the next call into any client API method; it should be immediately copied by the client if the client wants to reference it later.

Exceptions

PDAnnotGetTitle

Header: PDProcs.h:479

Description

Gets an annotation's label text.

Note: This text is stored in either PDFDocEncoding or in Unicode. If it is stored in Unicode, a valid Byte Order Mark must be present.

Syntax

ASInt32 PDAnnotGetTitle(PDAnnot anAnnot, char *buffer, ASInt32 bufSize);

Parameters

anAnnot
IN/OUT The annotation whose label is obtained.
buffer
IN/OUT (Filled by the method) The string into which the annotation's label string is copied. If the string is non- NULL, up to bufsSize bytes are copied into the buffer.
bufSize
IN/OUT The buffer size in bytes. Up to bufSize bytes of the annotation label string are copied into the string and an ASCII NULL character is appended. The caller is expected to have allocated bufSize + 1 bytes to allow for the NULL. If buffer is NULL, it copies nothing.

Returns

If the string is non- NULL, it returns the number of bytes copied, not counting the trailing NULL. If the string is NULL, it returns the number of bytes that would be copied if the string were not NULL.

Exceptions

PDAnnotGetTitleASText

Header: PDProcs.h:11493

Description

Gets an annotation's label text as an ASText object.

Syntax

void PDAnnotGetTitleASText(PDAnnot anAnnot, ASText title);

Parameters

anAnnot
The annotation whose label is obtained.
title
(Filled by the method) The text object containing the annotation's label string. The client must pass a valid ASText object title. The routine does not allocate it.

Exceptions

PDAnnotIsCurrentlyVisible

Header: PDProcs.h:9456

Description

Tests whether an annotation with an OC entry is visible in a given optional-content context, considering the current ON-OFF states of the optional-content groups in the optional-content dictionary (OCMD) and the dictionary's visibility policy.

Related Methods

Syntax

ASBool PDAnnotIsCurrentlyVisible(PDAnnot annot, PDOCContext ocContext);

Parameters

annot
The annotation to test.
ocContext
The optional-content context in which the visibility is tested.

Returns

true if the annotation is visible in the given context or if the annotation has no OC entry, false if it is hidden.

PDAnnotIsValid

Header: PDProcs.h:326

Description

Tests whether an annotation is valid. This is intended only to ensure that the annotation has not been deleted, not to ensure that all necessary information is present and valid.

Related Methods

Syntax

ASBool PDAnnotIsValid(PDAnnot anAnnot);

Parameters

anAnnot
The annotation whose validity is tested.

Returns

true if anAnnot is a valid annotation object, false otherwise. An annotation is valid if it is a Cos dictionary object and has a Rect key.

PDAnnotNotifyDidChange

Header: PDProcs.h:274

Description

Broadcasts a PDAnnotDidChange() notification. Clients must call this method after making any change to a custom annotation.

Related Methods

Syntax

void PDAnnotNotifyDidChange(PDAnnot annot, ASAtom key, ASInt32 err);

Parameters

annot
The annotation that has changed.
key
The ASAtom corresponding to the name of the key in the annotation's Cos dictionary that is changing.
err
An error code to pass to any method registered to receive the PDAnnotDidChange() notification. Pass zero if the annotation was changed successfully. Pass a nonzero value if an error occurred while changing the annotation.

PDAnnotNotifyWillChange

Header: PDProcs.h:255

Description

Broadcasts a PDAnnotWillChange() notification. Clients must call this method before making any change to a custom annotation.

Related Methods

Syntax

void PDAnnotNotifyWillChange(PDAnnot annot, ASAtom key);

Parameters

annot
The annotation that has changed.
key
The ASAtom corresponding to the name of the key in the annotation's Cos dictionary that is changing.

PDAnnotPaste

Header: PDProcs.h:11003

Description

Pastes copied annotation data from a clipboard structure to a new annotation object in a specified document. After successfully pasting the data, use PDAnnotDestroyClipboardData() to free the associated memory.

Syntax

PDAnnot PDAnnotPaste(PDPage destPage, const ASFixedPoint *center, PDAnnotClipboardData data);

Parameters

destPage
The page to which the annotation is pasted.
center
The location for the center of the annotation on the destination page, or a NULL pointer to center the annotation on the destination page.
data
The copied annotation data to paste.

Returns

A newly created annotation object associated with the specified document, containing the same data as the copied annotation.

PDAnnotRemoveOCMD

Header: PDProcs.h:9401

Description

Dissociates any optional-content membership dictionary (OCMD) object from the annotation.

Syntax

void PDAnnotRemoveOCMD(PDAnnot annot);

Parameters

annot
The annotation for which to remove the dictionary.

PDAnnotSetColor

Header: PDProcs.h:449

Description

Sets a note or link annotation's color. Only RGB color specifications are currently supported.

Syntax

void PDAnnotSetColor(PDAnnot anAnnot, const PDColorValue color);

Parameters

anAnnot
IN/OUT The note or link annotation whose color is set.
color
IN/OUT The annotation's color, which is used as follows:
Annotation
Use
Closed text note
The icon background color.
Open, un-selected text note
The bounding rectangle color.
Open, selected text note
The color of the annotation's title bar.
Link annotation
The link border color.

PDAnnotSetDate

Header: PDProcs.h:537

Description

Sets an annotation's date.

Syntax

void PDAnnotSetDate(PDAnnot anAnnot, const ASTimeRecP date);

Parameters

anAnnot
IN/OUT The annotation whose date is set.
date
IN/OUT The annotation's time and date.

PDAnnotSetFlags

Header: PDProcs.h:733

Description

Sets an annotation's flags.

Syntax

void PDAnnotSetFlags(PDAnnot anAnnot, ASUns32 flags);

Parameters

anAnnot
IN/OUT The annotation whose flags are set.
flags
IN/OUT An OR of the PDAnnot Flags values.

PDAnnotSetOCMD

Header: PDProcs.h:9375

Description

Associates an optional-content membership dictionary (OCMD) object with the annotation, making it optionally visible according to the OCMD's visibility policy. If the annotation already has a dictionary, the method replaces it.

Syntax

void PDAnnotSetOCMD(PDAnnot annot, PDOCMD pdocmd);

Parameters

annot
The annotation for which to set the dictionary.
pdocmd
The new dictionary.

PDAnnotSetRect

Header: PDProcs.h:380

Description

Sets the size and location of an annotation on its page.

Syntax

void PDAnnotSetRect(PDAnnot anAnnot, const ASFixedRect *newBox);

Parameters

anAnnot
IN/OUT The annotation whose location and size are set.
newBox
IN/OUT A pointer to a rectangle that specifies the annotation's bounding rectangle, specified in user space coordinates.

PDAnnotSetTitle

Header: PDProcs.h:501

Description

Sets an annotation's label text.

Note: This text is stored in either PDFDocEncoding or in Unicode. If it is stored in Unicode, a valid Byte Order Mark must be present.

Syntax

void PDAnnotSetTitle(PDAnnot anAnnot, const char *str, ASInt32 nBytes);

Parameters

anAnnot
IN/OUT The annotation whose label is set.
str
IN/OUT The string containing the label to set.
nBytes
IN/OUT The length of the label. The first nBytes bytes of str are used as the label.

PDAnnotSetTitleASText

Header: PDProcs.h:11512

Description

Sets an annotation's label text.

Syntax

void PDAnnotSetTitleASText(PDAnnot anAnnot, const ASText title);

Parameters

anAnnot
The annotation whose label is set.
title
The text object containing the label to set.