PSPDFOutlineElement


@interface PSPDFOutlineElement : PSPDFModel

Represents a single outline/table of contents element.

  • Init with title, page, child elements and indentation level.

    Declaration

    Objective-C

    - (nonnull instancetype)
    initWithTitle:(nullable NSString *)title
            color:(nullable UIColor *)color
       fontTraits:(UIFontDescriptorSymbolicTraits)fontTraits
           action:(nullable PSPDFAction *)action
         children:(nullable NSArray<PSPDFOutlineElement *> *)children
            level:(NSUInteger)level;

    Swift

    init(title: String?, color: UIColor?, fontTraits: UIFontDescriptorSymbolicTraits, action: PSPDFAction?, children: [PSPDFOutlineElement]?, level: UInt)
  • Returns all elements + flattened subelements if they are expanded

    Declaration

    Objective-C

    @property (readonly, nonatomic)
        NSArray<PSPDFOutlineElement *> *_Nonnull flattenedChildren;

    Swift

    var flattenedChildren: [PSPDFOutlineElement] { get }
  • All elements, ignores expanded state.

    Declaration

    Objective-C

    @property (readonly, nonatomic)
        NSArray<PSPDFOutlineElement *> *_Nonnull allFlattenedChildren;

    Swift

    var allFlattenedChildren: [PSPDFOutlineElement] { get }
  • Outline elements parent. nil if it has no parent.

    Declaration

    Objective-C

    @property (readonly, nonatomic) PSPDFOutlineElement *_Nullable parent;

    Swift

    weak var parent: PSPDFOutlineElement? { get }
  • Outline title.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSString *title;

    Swift

    var title: String? { get }
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFOutlineElement : PSPDFModel
  • Convenience shortcut for self.action.pageIndex (if action is of type PSPDFGoToAction) Page is set to NSNotFound if action is nil or a different type.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSUInteger pageIndex;

    Swift

    var pageIndex: UInt { get }
  • Bookmark can have a color. (Optional; PDF 1.4) PSDPFKit defaults to system text color when presenting if nil.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) UIColor *color;

    Swift

    var color: UIColor? { get }
  • A bookmark can be optionally bold or italic. (Optional; PDF 1.4)

    Declaration

    Objective-C

    @property (readonly, nonatomic) UIFontDescriptorSymbolicTraits fontTraits;

    Swift

    var fontTraits: UIFontDescriptorSymbolicTraits { get }
  • Child elements.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic, nullable)
        NSArray<PSPDFOutlineElement *> *children;

    Swift

    var children: [PSPDFOutlineElement]? { get }
  • Current outline level.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSUInteger level;

    Swift

    var level: UInt { get }
  • Expansion state of current outline element (will not be persisted)

    Declaration

    Objective-C

    @property (getter=isExpanded, assign, readwrite, atomic) BOOL expanded;

    Swift

    var isExpanded: Bool { get set }