| Inherits from | |
| Conforms to | |
| Framework | Library/Frameworks/Quartz.framework/Frameworks/PDFKit.framework |
| Availability | Available in Mac OS X v10.4 and later.
|
| Declared in | PDFOutline.h |
A PDFOutline object is an element in a tree-structured hierarchy that can represent the structure of a PDF document.
An outline is an optional component of a PDF document, useful for viewing the structure of the document and for navigating within it.
Outlines are created by the document’s author. If you represent a PDF document outline using outline objects, the root of the hierarchy is obtained from the PDF document itself. This root outline is not visible and serves merely as a container for the visible outlines.
Returns the action performed when users click the outline.
- (PDFAction *)action
The root outline serves only as a container for the outlines it owns; it does not have an action. Note that a PDFOutline object can have either an action or a destination, not both.
If the PDFOutline object has a destination, instead of an action, action returns a PDFActionGoTo object (this is equivalent to calling destination on the PDFOutline object). For other action types, action returns the appropriate PDF Kit action type object, such as PDFActionURL.
PDFOutline.hReturns the child outline object at the specified index.
- (PDFOutline *)childAtIndex:(NSUInteger)index
The index is zero-based. This method throws an exception if index is out of range.
Important: In Mac OS X v10.5 and later, a PDFOutline object retains all its children, so childAtIndex: returns the same retained child outline object every time it’s called. This means that you do not need to retain the object returned by childAtIndex:. This differs from the behavior of PDFOutline in Mac OS X v10.4. In Tiger, childAtIndex: returns an auto-released, one-off child outline object, when meant that you had to include code to retain the child.
PDFOutline.hReturns the destination associated with the outline.
- (PDFDestination *)destination
The root outline serves only as a container for the outlines it owns; it does not have a destination. Note that a PDFOutline object can have either a destination or an action, not both.
This method may return NULL if the outline has an associated action instead of a destination. Note that if the associated action is a PDFActionGoTo, this method returns the destination from the PDFActionGoTo object. However, it is better to use the action method for this purpose.
PDFOutline.hReturns the document with which the outline is associated.
- (PDFDocument *)document
PDFOutline.hReturns the index of the outline.
- (NSUInteger)index
The index of the outline object is relative to its siblings and from the perspective of the parent of the outline object. The root outline object, and any outline object without a parent, has an index value of 0.
PDFOutline.hInitializes a PDFOutline object.
- (id)init
If you want the PDFOutline object returned by this method to be the outline root, you must add additional PDFOutline objects to create the outline hierarchy you desire. Then, you must add the root outline object to your PDF document by passing it to the PDFDocument setOutlineRoot: method.
If you want the PDFOutline object returned by this method to be a child of an existing outline, you must use setLabel: to give it a label and give it either a destination or action using setDestination: or setAction:, respectively. In addition, you must add this outline object to the existing PDFOutline object as a new child, using insertChild:atIndex:
PDFOutline.hInitializes an outline with the specified PDF document. (Deprecated. Use the PDFDocument outlineRoot method instead.)
- (id)initWithDocument:(PDFDocument *)document
Returns NULL if the document does not contain an outline. Invoking this method is equivalent to sending the outlineRoot message to a PDFDocument object.
PDFOutline.hInserts the specified outline object at the specified index.
- (void)insertChild:(PDFOutline *)child atIndex:(NSUInteger)index
To build a PDF outline hierarchy, use this method to add child outline objects. Before you call this method on a PDFOutline object that already has a parent, you should retain the object and call removeFromParent on it first.
PDFOutline.hReturns a Boolean value that indicates whether the outline object is initially disclosed.
- (BOOL)isOpen
Calling isOpen on an outline object that has no children always returns NO. Calling isOpen on the root outline object always returns YES.
PDFOutline.hReturns the label for the outline.
- (NSString *)label
The root outline serves only as a container for the outlines it owns; it does not have a label.
PDFOutline.hReturns the number of child outline objects in the outline.
- (NSUInteger)numberOfChildren
PDFOutline.hReturns the parent outline object of the outline (returns NULL if called on the root outline object).
- (PDFOutline *)parent
PDFOutline.hRemoves the outline object from its parent (does nothing if outline object is the root outline object).
- (void)removeFromParent
PDFOutline.hSets the action associated with the outline.
- (void)setAction:(PDFAction *)action
Calling setAction on the root outline object has no effect, because the root outline does not have an action or a destination..
PDFOutline.hSets the destination associated with the outline.
- (void)setDestination:(PDFDestination *)destination
Calling setDestination on the root outline object has no effect, because the root outline does not have an action or a destination.
PDFOutline.hSets the initial disclosure state of the outline object.
- (void)setIsOpen:(BOOL)open
Calling setIsOpen on an outline object with no children or on the root outline object has no effect.
PDFOutline.hSets the label for the outline (has no effect on the root outline object).
- (void)setLabel:(NSString *)label
PDFOutline.h
Last updated: 2007-12-11