Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

PDFAnnotationTextWidget Class Reference

Inherits from
Conforms to
Framework
Library/Frameworks/Quartz.framework/Frameworks/PDFKit.framework
Availability
Available in Mac OS X v10.4 and later.
Declared in
PDFAnnotationTextWidget.h

Overview

A PDFAnnotationTextWidget object allows you to manage the appearance and content of text fields.

PDFAnnotationTextWidget objects support interactive forms in a PDF document. This object is comparable to an editable NSTextField in Cocoa or an edit text view in Carbon.

Tasks

Working with Annotation Strings

Managing the Font and Font Color

Managing Background Color, Alignment, and Rotation

Working with Field Names

Instance Methods

alignment

Returns the text alignment setting for the annotation.

- (NSTextAlignment)alignment

Return Value

The text alignment value for the annotation. Supported alignment values are NSLeftTextAlignment, NSRightTextAlignment, and NSCenterTextAlignment.

Availability
See Also
Declared In
PDFAnnotationTextWidget.h

backgroundColor

Returns the background color of the annotation text field.

- (NSColor *)backgroundColor

Return Value

The background color of the annotation’s text field.

Availability
See Also
Declared In
PDFAnnotationTextWidget.h

fieldName

Returns the internal name for the annotation text field.

- (NSString *)fieldName

Return Value

The internal name for the annotation text field.

Discussion

Field names are optional, internal names that identify text fields in a PDF form. You use field names with the PDFActionResetForm action.

Note that multiple PDFAnnotationTextWidget objects with the same field name always have the same text associated with that field name. When text is entered into one of the objects, the text associated with that field name is changed in all objects. If you need to ensure unique text for a PDFAnnotationTextWidget object, you must give it a unique field name (you can use setFieldName: to do this).

Availability
See Also
Declared In
PDFAnnotationTextWidget.h

font

Returns the font used for the annotation’s text field.

- (NSFont *)font

Return Value

The font used for text in the annotation’s text field.

Availability
See Also
Declared In
PDFAnnotationTextWidget.h

fontColor

Returns the font color used for the annotation’s text field.

- (NSColor *)fontColor

Return Value

The font color used for text in the annotation’s text field.

Availability
See Also
Declared In
PDFAnnotationTextWidget.h

maximumLength

Returns the maximum number of characters allowed in the annotation string.

- (NSUInteger)maximumLength

Return Value

The maximum number of characters allowed in the annotations string. A return value of 0 means that there is no specified maximum.

Availability
See Also
Declared In
PDFAnnotationTextWidget.h

rotation

Returns the rotation angle of the annotation text field in degrees.

- (int)rotation

Return Value

The rotation angle of the annotation text field in degrees.

Discussion

Note that the rotation value is a positive multiple of 90, such as 0, 90, 180, or 270. The rotation of annotation text fields with negative rotation is converted to a corresponding positive rotation. For example, -90 is changed to 270.

Availability
See Also
Declared In
PDFAnnotationTextWidget.h

setAlignment:

Sets the text alignment for the annotation.

- (void)setAlignment:(NSTextAlignment)alignment

Parameters
alignment

The text-alignment value to be used for the annotation. Possible values are NSLeftTextAlignment, NSRightTextAlignment, and NSCenterTextAlignment.

Availability
See Also
Declared In
PDFAnnotationTextWidget.h

setBackgroundColor:

Sets the background color of the annotation text field.

- (void)setBackgroundColor:(NSColor *)color

Parameters
color

The color to be used in the background of the annotation’s text field.

Availability
See Also
Declared In
PDFAnnotationTextWidget.h

setFieldName:

Sets the internal field name for the annotation text field.

- (void)setFieldName:(NSString *)name

Parameters
name

The internal field name to be used for the annotation text field.

Discussion

Field names are optional, internal names that identify text fields in a PDF form. You use field names with the PDFActionResetForm action.

Note that multiple PDFAnnotationTextWidget objects with the same field name always have the same text associated with that field name. When text is entered into one of the objects, the text associated with that field name is changed in all objects. If you need to ensure unique text for a PDFAnnotationTextWidget object, you must give it a unique field name.

Availability
See Also
Declared In
PDFAnnotationTextWidget.h

setFont:

Sets the font used in the text field of the annotation.

- (void)setFont:(NSFont *)font

Parameters
font

The font to be used in the annotation’s text field.

Availability
See Also
Declared In
PDFAnnotationTextWidget.h

setFontColor:

Sets the font color used for the annotation’s text field.

- (void)setFontColor:(NSColor *)color

Parameters
color

The font color to be used in the annotation’s text field.

Availability
See Also
Declared In
PDFAnnotationTextWidget.h

setMaximumLength:

Sets the maximum number of characters allowed in the annotation string.

- (void)setMaximumLength:(NSUInteger)maxLen

Parameters
maxLen

The maximum number of characters allowed in the annotation string. Pass 0 to indicate that there is no specified maximum.

Availability
See Also
Declared In
PDFAnnotationTextWidget.h

setRotation:

Sets the rotation angle of the annotation text field in degrees.

- (void)setRotation:(int)rotation

Parameters
rotation

The rotation angle to be applied to the annotation text field, in degrees. The rotation angle must be a positive or negative multiple of 90 (negative angles are converted to their positive equivalents; for example -90 is changed to 270).

Availability
See Also
Declared In
PDFAnnotationTextWidget.h

setStringValue:

Sets the string for the annotation.

- (void)setStringValue:(NSString *)value

Parameters
value

The string to be assigned to the annotation.

Availability
See Also
Declared In
PDFAnnotationTextWidget.h

stringValue

Returns the string assigned to the annotation.

- (NSString *)stringValue

Return Value

The string assigned to the annotation.

Availability
See Also
Declared In
PDFAnnotationTextWidget.h

Next Page > Hide TOC


Last updated: 2007-12-11




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice