List of usage examples for org.apache.pdfbox.pdmodel.common PDPageLabels getPageIndicesByLabels
public Map<String, Integer> getPageIndicesByLabels()
From source file:com.trollworks.gcs.pdfview.PdfPanel.java
License:Open Source License
public void goToPage(PdfRef pdfRef, int page, String highlight) { if (!mIgnorePageChange && mPdf != null) { int lastPageIndex = mPageIndex; mPageIndex = page;// ww w .j a va 2 s. c o m try { PDPageLabels pageLabels = mPdf.getDocumentCatalog().getPageLabels(); if (pageLabels != null) { Integer result = pageLabels.getPageIndicesByLabels().get(Integer.toString(page)); if (result != null) { mPageIndex = result.intValue(); } } } catch (Exception exception) { // Had no catalog... we will just use the original page number } mPageIndex += pdfRef.getPageToIndexOffset(); if (mPageIndex != lastPageIndex || isHighlightNew(highlight)) { mHighlight = highlight; markPageForLoading(); } } }