LayerPD_Layer
ObjectPDTextAnnot

A PDTextAnnot corresponds to a PDF text annotation. For details, see Text Annotations in Section 8.4.5, Annotation Types, in the PDF Reference. You can use any PDAnnot method on a PDTextAnnot.

Plug-ins can use PDTextAnnot methods to:

The Acrobat SDK provides three useful macros to cast among PDAnnot and its text annotation and link annotation subclasses. These are (see PDExpT.h):



Define Summary
 Define
 CastToPDTextAnnot
Casts a link annotation or a generic annotation to a text annotation.
Typedef Summary
 Typedef
 PDTextAnnot
A PDF text annotation on a page in a PDF file. You can use any PDAnnot method on a PDTextAnnot.
Method Summary
 Method
 
ASInt32 PDTextAnnotGetContents(PDTextAnnot aTextAnnot, char* buffer, ASInt32 bufSize)
Gets the text of a text annotation.
 
Gets the text of a text annotation as an ASText object.
 
ASBool PDTextAnnotIsOpen(PDTextAnnot aTextAnnot)
Tests whether a text annotation is open.
 
void PDTextAnnotSetContents(PDTextAnnot aTextAnnot, const char* str, ASInt32 nBytes)
Sets the text of a text annotation. This method also sets the modification date of the annotation to the current date and time.
 
void PDTextAnnotSetContentsASText(PDTextAnnot aTextAnnot, const ASText contents)
Sets the text of a text annotation.
 
void PDTextAnnotSetOpen(PDTextAnnot aTextAnnot, ASBool isOpen)
Opens or closes a text annotation.
Defines Detail
CastToPDTextAnnot 
Product availability: All
Platform availability: All

Syntax

#define CastToPDTextAnnot *(PDTextAnnot *)&(a)

Description

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

See Also


File: PDExpT.h
Line: 436

Typedefs Detail
PDTextAnnot 
Product availability: All
Platform availability: All

Syntax

typedef OPAQUE_64_BITS PDTextAnnot;

A PDF text annotation on a page in a PDF file. You can use any PDAnnot method on a PDTextAnnot.

Applications can:

To obtain a PDF text annotation, use any of the PDAnnot calls, followed by CastToPDTextAnnot(). The annotation passed to CastToPDTextAnnot() must be a text annotation; it will not convert other annotation types into text annotations.

See Also


File: PDExpT.h
Line: 340



Method Detail
PDTextAnnotGetContents()
Product availability: All
Platform availability: All

Syntax

ASInt32 PDTextAnnotGetContents(PDTextAnnot aTextAnnot, char* buffer, ASInt32 bufSize)

Gets the text of a text annotation.

Parameters

aTextAnnot — 

The text annotation whose text is obtained.

 
buffer — 

(Filled by the method) A buffer into which the text is placed. If the text is encoded using PDFDocEncoding, it can be converted to a platform's native encoding using PDXlateToHost() or PDXlateToHostEx().

 
bufSize — 

The maximum number of characters that buffer can hold.

Returns

The number of characters written into buffer.

See Also

Since

PI_PDMODEL_VERSION >= 0x00020000

File: PDProcs.h
Line: 585
PDTextAnnotGetContentsASText() 
Product availability: All
Platform availability: All

Syntax

void PDTextAnnotGetContentsASText(PDTextAnnot aTextAnnot, ASText contents)

Gets the text of a text annotation as an ASText object.

Parameters

aTextAnnot — 

The text annotation whose text is obtained.

 
contents — 

(Filled by the method) The text object containing the contents. The client must pass a valid ASText object title. The routine does not allocate it.

See Also

Since

PI_PDMODEL_VERSION >= 0x00080000

File: PDProcs.h
Line: 11346
PDTextAnnotIsOpen() 
Product availability: All
Platform availability: All

Syntax

ASBool PDTextAnnotIsOpen(PDTextAnnot aTextAnnot)

Tests whether a text annotation is open.

Parameters

aTextAnnot — 

The text annotation whose open/closed state is obtained.

Returns

true if the annotation is open, false otherwise.

See Also

Since

PI_PDMODEL_VERSION >= 0x00020000

File: PDProcs.h
Line: 628
PDTextAnnotSetContents() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDTextAnnotSetContents(PDTextAnnot aTextAnnot, const char* str, ASInt32 nBytes)

Sets the text of a text annotation. This method also sets the modification date of the annotation to the current date and time.

Parameters

aTextAnnot — 

The text annotation whose text is set.

 
str — 

A string containing the new text. The string must be encoded using PDFDocEncoding or Unicode. The strings in a platform's native encoding can be converted to PDFDocEncoding using PDXlateToPDFDocEnc() or PDXlateToPDFDocEncEx().

 
nBytes — 

The number of characters in str.

See Also

Notifications

Since

PI_PDMODEL_VERSION >= 0x00020000

File: PDProcs.h
Line: 607
PDTextAnnotSetContentsASText() 
Product availability: All
Platform availability: All

Syntax

void PDTextAnnotSetContentsASText(PDTextAnnot aTextAnnot, const ASText contents)

Sets the text of a text annotation.

Parameters

aTextAnnot — 

The text annotation whose text is set.

 
contents — 

The text object containing the new text.

See Also

Notifications

Since

PI_PDMODEL_VERSION >= 0x00080000

File: PDProcs.h
Line: 11361
PDTextAnnotSetOpen() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDTextAnnotSetOpen(PDTextAnnot aTextAnnot, ASBool isOpen)

Opens or closes a text annotation.

Parameters

aTextAnnot — 

The annotation to open or close.

 
isOpen — 

true if the annotation is opened, false if the annotation is closed.

See Also

Notifications

Since

PI_PDMODEL_VERSION >= 0x00020000

File: PDProcs.h
Line: 650