CPDFOutline Class Reference
Inherits from | NSObject |
---|---|
Declared in | CPDFOutline.h |
Overview
A CPDFOutline 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.
document
Returns the document with which the outline is associated.
@property (nonatomic, readonly) CPDFDocument *document
Discussion
Returns the document with which the outline is associated.
Declared In
CPDFOutline.h
parent
Returns the parent outline object of the outline (returns NULL if called on the root outline object).
@property (nonatomic, readonly) CPDFOutline *parent
Discussion
Returns the parent outline object of the outline (returns NULL if called on the root outline object).
Declared In
CPDFOutline.h
numberOfChildren
Returns the number of child outline objects in the outline.
@property (nonatomic, readonly) NSUInteger numberOfChildren
Discussion
Returns the number of child outline objects in the outline.
Declared In
CPDFOutline.h
index
Returns the index of the outline item, relative to its siblings (and from the perspective of the parent).
@property (nonatomic, readonly) NSUInteger index
Discussion
Returns the index of the outline item, relative to its siblings (and from the perspective of the parent).
The root outline item (or any item with no parent) is always index 0.
Declared In
CPDFOutline.h
label
Method to get / set the label for the outline.
@property (nonatomic, retain) NSString *label
Discussion
Method to get / set the label for the outline.
The root outline serves only as a container for the outlines it owns; it does not have a label.
Declared In
CPDFOutline.h
destination
Method to get / set the destination associated with the outline.
@property (nonatomic, retain) CPDFDestination *destination
Discussion
Method to get / set the destination associated with the outline.
The root outline serves only as a container for the outlines it owns; it does not have a destination. Note that a CPDFOutline 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 CPDFGoToAction, this method returns the destination from the CPDFGoToAction object. However, it is better to use the action method for this purpose.
Declared In
CPDFOutline.h
action
Method to get / set the action performed when users click the outline.
@property (nonatomic, retain) CPDFAction *action
Discussion
Method to get / set the action performed when users click the outline.
The root outline serves only as a container for the outlines it owns; it does not have an action. Note that a CPDFOutline object can have either an action or a destination, not both. If the CPDFOutline object has a destination, instead of an action, action returns a CPDFGoToAction object (this is equivalent to calling destination on the CPDFOutline object). For other action types, action returns the appropriate PDF Kit action type object, such as CPDFURLAction.
Declared In
CPDFOutline.h
– childAtIndex:
Returns the child outline object at the specified index.
- (CPDFOutline *)childAtIndex:(NSUInteger)index
Discussion
Returns the child outline object at the specified index.
The index is zero-based. This method throws an exception if index is out of range. 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:.
Declared In
CPDFOutline.h
– insertChildAtIndex:
Create a outline object and inserts the outline object at the specified index.
- (CPDFOutline *)insertChildAtIndex:(NSUInteger)index
Discussion
Create a outline object and inserts the outline object at the specified index.
To build a PDF outline hierarchy, use this method to add child outline objects.
Declared In
CPDFOutline.h
– insertChild:atIndex:
When moving items around within an outline hierarchy, you should retain the item and call -[removeFromParent] first.
- (void)insertChild:(CPDFOutline *)child atIndex:(NSUInteger)index
Discussion
When moving items around within an outline hierarchy, you should retain the item and call -[removeFromParent] first.
Declared In
CPDFOutline.h