PSPDFOutlineParser

Objective-C


@interface PSPDFOutlineParser : NSObject <PSPDFOverridable>

Swift

class OutlineParser : NSObject, Overridable

Parses the Outline/Table of Contents of a PDF.

  • Unavailable

    Not the designated initializer

    Undocumented

    Declaration

    Objective-C

    PSPDF_EMPTY_INIT_UNAVAILABLE
  • Unavailable

    Not the designated initializer

    Undocumented

    Declaration

    Objective-C

    PSPDF_EMPTY_INIT_UNAVAILABLE
  • Returns a single outline element for the specified page.

    If exactPageOnly is set, the outline will only be returned if it’s from the specific page. Else the last active set outline will be returned.

    Note

    This call needs to crawl the entire outline and figure out the destination page for each outline element. For complex documents this can take a non-trivial amount of time the first time the method is executed.

    Declaration

    Objective-C

    - (nullable PSPDFOutlineElement *)
        outlineElementForPageAtIndex:(PSPDFPageIndex)pageIndex
                       exactPageOnly:(BOOL)exactPageOnly;

    Swift

    func outlineElementForPage(at pageIndex: PageIndex, exactPageOnly: Bool) -> PSPDFOutlineElement?
  • Returns cached outline. starts parsing if outline is not yet created. Will always return at least a root element.

    Declaration

    Objective-C

    @property (nonatomic) PSPDFOutlineElement *_Nonnull outline;

    Swift

    var outline: PSPDFOutlineElement { get set }
  • Returns YES if outline is already parsed.

    Declaration

    Objective-C

    @property (readonly, getter=isOutlineParsed) BOOL outlineParsed;

    Swift

    var isOutlineParsed: Bool { get }
  • Returns YES if there is an outline in the document and we parsed it (outline.children > 0) Will parse the outline if needed.

    Declaration

    Objective-C

    @property (nonatomic, readonly, getter=isOutlineAvailable) BOOL outlineAvailable;

    Swift

    var isOutlineAvailable: Bool { get }
  • Attached document provider.

    Declaration

    Objective-C

    @property (nonatomic, weak, readonly) PSPDFDocumentProvider *_Nullable documentProvider;

    Swift

    weak var documentProvider: PSPDFDocumentProvider? { get }