PTPageLabelManager
@interface PTPageLabelManager : NSObject <PTOverridable>
Instances of the PTPageLabelManager class manage the page labels associated with the PTPDFDoc
of a PTPDFViewCtrl instance.
-
Initializes a
PTPageLabelManagerinstance.Declaration
Objective-C
- (nonnull instancetype)initWithPDFViewCtrl: (nonnull PTPDFViewCtrl *)pdfViewCtrl;Swift
init(pdfViewCtrl: PTPDFViewCtrl)Parameters
pdfViewCtrlthe PDFViewCtrl
Return Value
an initialized
PTPageLabelManagerinstance -
The
PTPDFViewCtrlassociated with this page label manager.Declaration
Objective-C
@property (nonatomic, strong, nullable) PTPDFViewCtrl *pdfViewCtrl;Swift
var pdfViewCtrl: PTPDFViewCtrl? { get set } -
Returns the page label for the given page number of the current
PTPDFDocin thepdfViewCtrl.Declaration
Objective-C
- (nullable PTPageLabel *)pageLabelForPageNumber:(int)pageNumber;Swift
func pageLabel(forPageNumber pageNumber: Int32) -> PTPageLabel?Parameters
pageNumberthe page number for which to get the label
Return Value
the page label for the given page number, or
nilif no page label is set -
Returns the page label prefix for the given page number of the current
PTPDFDocin thepdfViewCtrl.Declaration
Objective-C
- (nullable NSString *)pageLabelPrefixForPageNumber:(int)pageNumber;Swift
func pageLabelPrefix(forPageNumber pageNumber: Int32) -> String?Parameters
pageNumberthe page number for which to get the label prefix
Return Value
the page label prefix for the given page number, or
nilif no page label is set -
Returns the page label title for the given page number of the current
PTPDFDocin thepdfViewCtrl.Declaration
Objective-C
- (nullable NSString *)pageLabelTitleForPageNumber:(int)pageNumber;Swift
func pageLabelTitle(forPageNumber pageNumber: Int32) -> String?Parameters
pageNumberthe page number for which to get the label title
Return Value
the page label title for the given page number, or
nilif no page label is set -
Returns the page number for the given page label title of the current
PTPDFDocin thepdfViewCtrl.Declaration
Objective-C
- (int)pageNumberForPageLabelTitle:(nonnull NSString *)pageLabelTitle;Swift
func pageNumber(forPageLabelTitle pageLabelTitle: String) -> Int32Parameters
pageLabelTitlethe page number for the given page label title, or
0if the page label cannot be foundReturn Value
the page number for the given page label title, or
0if the page label cannot be found -
Sets the page label for the given page range with the specified style, prefix, and starting value.
Declaration
Objective-C
- (nullable PTPageLabel *)setPageLabelStyle:(PTPageLabelStyle)pageLabelStyle fromPageNumber:(int)firstPageNumber toPageNumber:(int)lastPageNumber;Swift
func setPageLabelStyle(_ pageLabelStyle: PTPageLabelStyle, fromPageNumber firstPageNumber: Int32, toPageNumber lastPageNumber: Int32) -> PTPageLabel?Parameters
pageLabelStyleone of
e_ptdecimal,e_ptroman_uppercase,e_ptroman_lowercase,e_ptalphabetic_uppercase,e_ptalphabetic_lowercase, ore_ptpg_nonefirstPageNumberthe first page number associated with this page label
lastPageNumberthe last page associated with this page label
Return Value
the page label set to this page, or
nilif unsuccessfully set -
Sets the page label for the given page range with the specified style, prefix, and starting value.
Declaration
Objective-C
- (nullable PTPageLabel *)setPageLabelStyle:(PTPageLabelStyle)pageLabelStyle prefix:(nullable NSString *)prefix startValue:(int)startValue fromPageNumber:(int)firstPageNumber toPageNumber:(int)lastPageNumber;Swift
func setPageLabelStyle(_ pageLabelStyle: PTPageLabelStyle, prefix: String?, startValue: Int32, fromPageNumber firstPageNumber: Int32, toPageNumber lastPageNumber: Int32) -> PTPageLabel?Parameters
pageLabelStyleone of
e_ptdecimal,e_ptroman_uppercase,e_ptroman_lowercase,e_ptalphabetic_uppercase,e_ptalphabetic_lowercase, ore_ptpg_noneprefixtext to prepend to the page label title
startValuethe value to use when generating the numeric portion of the first label in this range
firstPageNumberthe first page number associated with this page label
lastPageNumberthe last page associated with this page label
Return Value
the page label set to this page, or
nilif unsuccessfully set -
Removes all of the page labels of the
PTPDFDocin thepdfViewCtrl.Declaration
Objective-C
- (void)removeAllPageLabels;Swift
func removeAllPageLabels() -
Executes a given block for every page label’s pages of the
PTPDFDocin thepdfViewCtrl. The block is executed for every page number that a page label applies.Declaration
Objective-C
- (void)enumeratePageLabelsStartingAtPageNumber:(int)startPageNumber withBlock:(nonnull void (^)( PTPageLabel *_Nonnull, int, BOOL *_Nonnull))block;Swift
func enumeratePageLabelsStarting(atPageNumber startPageNumber: Int32, with block: @escaping (PTPageLabel, Int32, UnsafeMutablePointer<ObjCBool>) -> Void)Parameters
startPageNumberthe page number at which to begin enumerating the page labels
blockthe block to execute for every page label’s pages
PTPageLabelManager Class Reference