#define CastToPDTextAnnot ( a ) *( PDTextAnnot *) &( a )
a | The link annotation or generic annotation to cast.
|
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.
typedef OPAQUE_64_BITS PDTextAnnot;
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.
ASInt32 PDTextAnnotGetContents(PDTextAnnot aTextAnnot, char *buffer, ASInt32 bufSize);
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. |
buffer. void PDTextAnnotGetContentsASText(PDTextAnnot aTextAnnot, ASText contents);
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.
|
Note: This method cannot always correctly determine a text annotation's open state. For the current version of Acrobat, text and other annotations have an associated Popup annotation which maintains the open state of the popup window; the method works correctly when you pass it the popup annotation itself. You can use Cos-level routines to find the Popup entry in the annotation dictionary, which is itself a dictionary containing an Open entry.
ASBool PDTextAnnotIsOpen(PDTextAnnot aTextAnnot);
aTextAnnot | The text annotation whose open/closed state is obtained.
|
Note: The text must be encoded using PDFDocEncoding or Unicode.
void PDTextAnnotSetContents(PDTextAnnot aTextAnnot, const char *str, ASInt32 nBytes);
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. |
void PDTextAnnotSetContentsASText(PDTextAnnot aTextAnnot, const ASText contents);
aTextAnnot | The text annotation whose text is set.
|
contents | The text object containing the new text.
|
Note: This method cannot always correctly set a text annotation's open state. For the current version of Acrobat, text and other annotations have an associated Popup annotation which maintains the open state of the popup window; the method works correctly when you pass it the popup annotation itself. You can use Cos-level routines to find the Popup entry in the annotation dictionary, which is itself a dictionary containing an Open entry.
void PDTextAnnotSetOpen(PDTextAnnot aTextAnnot, ASBool isOpen);
aTextAnnot | The annotation to open or close.
|
isOpen |