public class

PageLabelUtils

extends Object
java.lang.Object
   ↳ com.pdftron.pdf.dialog.pagelabel.PageLabelUtils

Class Overview

Class containing utility methods for handling page labels in a PDF document.

Summary

Public Constructors
PageLabelUtils()
Public Methods
static PageLabel getPageLabel(PDFViewCtrl pdfViewCtrl, int page)
Gets page label for a page
static String getPageLabelPrefix(PDFViewCtrl pdfViewCtrl, int page)
Gets page label prefix for a given page.
static String getPageLabelTitle(PDFViewCtrl pdfViewCtrl, int page)
Gets page label title for a given page.
static int getPageNumberFromLabel(PDFViewCtrl pdfViewCtrl, String pageLabel)
Try to jump to a page label
static String getPageNumberIndicator(PDFViewCtrl pdfViewCtrl, int curPage, int pageCount)
Gets the page label in form of "curPage / pageCount"
static String getPageNumberIndicator(PDFViewCtrl pdfViewCtrl, int curPage)
Gets the page label in form of "curPage / pageCount"
static boolean setPageLabel(PDFViewCtrl pdfViewCtrl, int style, String prefix, int startValue, int fromPage, int toPage)
Sets the page label for the given page range, style, prefix, and starting value.
static boolean setPageLabel(PDFViewCtrl pdfViewCtrl, PageLabelSetting pageLabelSetting)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PageLabelUtils ()

Public Methods

public static PageLabel getPageLabel (PDFViewCtrl pdfViewCtrl, int page)

Gets page label for a page

Parameters
pdfViewCtrl the PDFViewCtrl
page the page
Returns
  • the page label

public static String getPageLabelPrefix (PDFViewCtrl pdfViewCtrl, int page)

Gets page label prefix for a given page.

Parameters
pdfViewCtrl the PDFViewCtrl
page the page
Returns
  • the page label title

public static String getPageLabelTitle (PDFViewCtrl pdfViewCtrl, int page)

Gets page label title for a given page.

Parameters
pdfViewCtrl the PDFViewCtrl
page the page
Returns
  • the page label title

public static int getPageNumberFromLabel (PDFViewCtrl pdfViewCtrl, String pageLabel)

Try to jump to a page label

Parameters
pdfViewCtrl the PDFViewCtrl
pageLabel the page label
Returns
  • page number if found, -1 if not found

public static String getPageNumberIndicator (PDFViewCtrl pdfViewCtrl, int curPage, int pageCount)

Gets the page label in form of "curPage / pageCount"

Parameters
pdfViewCtrl the PDFViewCtrl
curPage the current page number
pageCount the total page number
Returns
  • the page label

public static String getPageNumberIndicator (PDFViewCtrl pdfViewCtrl, int curPage)

Gets the page label in form of "curPage / pageCount"

Parameters
pdfViewCtrl the PDFViewCtrl
curPage the current page number
Returns
  • the page label

public static boolean setPageLabel (PDFViewCtrl pdfViewCtrl, int style, String prefix, int startValue, int fromPage, int toPage)

Sets the page label for the given page range, style, prefix, and starting value.

Parameters
pdfViewCtrl the PDFViewCtrl
style one of e_alphabetic_lowercase, e_alphabetic_uppercase e_decimal, e_none, e_roman_lowercase, e_roman_uppercase
prefix text to add to the page label title
startValue the value to use when generating the numeric portion of the first label in this range
fromPage the first page associated with this page label
toPage the last page associated with this page label
Returns
  • the page label set to this page, null if unsuccessfully set.

public static boolean setPageLabel (PDFViewCtrl pdfViewCtrl, PageLabelSetting pageLabelSetting)

Parameters
pdfViewCtrl the PDFViewCtrl
pageLabelSetting data model containing page modification user settings