@Test public void retrievePageLabelsOnMalformedPdf() throws IOException { PDDocument doc = null; try { doc = PDDocument.load(TestPDDocumentCatalog.class.getResourceAsStream("/pdfbox/com/tom_roush/pdfbox/pdmodel/badpagelabels.pdf")); PDDocumentCatalog cat = doc.getDocumentCatalog(); cat.getPageLabels().getLabelsByPageIndices(); } finally { if(doc != null) { doc.close(); } } }
public PDPageLabels getPageLabels() throws IOException { COSDictionary dict = (COSDictionary) root.getDictionaryObject(COSName.PAGE_LABELS); return dict == null ? null : new PDPageLabels(document, dict); }
PDDocumentCatalog implements COSObjectable { public PDPageLabels getPageLabels() throws IOException { COSDictionary dict = (COSDictionary) root.getDictionaryObject(COSName.PAGE_LABELS); return dict == null ? null : new PDPageLabels(document, dict); } }
PDDocumentCatalog implements COSObjectable { public PDPageLabels getPageLabels() throws IOException { COSDictionary dict = (COSDictionary) root.getDictionaryObject(COSName.PAGE_LABELS); return dict == null ? null : new PDPageLabels(document, dict); } PDDocumentCatalog(PDDocument doc);  PDDocumentCatalog(PDDocument doc, COSDictionary rootDictionary); }
PDDocumentCatalog implements COSObjectable { public PDPageLabels getPageLabels() throws IOException { COSDictionary dict = (COSDictionary) root.getDictionaryObject(COSName.PAGE_LABELS); return dict == null ? null : new PDPageLabels(document, dict); } PDDocumentCatalog(PDDocument doc);  PDDocumentCatalog(PDDocument doc, COSDictionary rootDictionary); COSDictionary getCOSObject(); PDAcroForm getAcroForm(); void setAcroForm(PDAcroForm acroForm); PDPageTree getPages(); PDViewerPreferences getViewerPreferences(); void setViewerPreferences(PDViewerPreferences prefs); PDDocumentOutline getDocumentOutline(); void setDocumentOutline(PDDocumentOutline outlines); List<PDThread> getThreads(); void setThreads(List threads); PDMetadata getMetadata(); void setMetadata(PDMetadata meta); void setOpenAction(PDDestinationOrAction action); PDDestinationOrAction getOpenAction(); PDDocumentCatalogAdditionalActions getActions(); void setActions(PDDocumentCatalogAdditionalActions actions); PDDocumentNameDictionary getNames(); PDDocumentNameDestinationDictionary getDests(); void setNames(PDDocumentNameDictionary names); PDMarkInfo getMarkInfo(); void setMarkInfo(PDMarkInfo markInfo); List<PDOutputIntent> getOutputIntents(); void addOutputIntent(PDOutputIntent outputIntent); void setOutputIntents(List<PDOutputIntent> outputIntents); PageMode getPageMode(); void setPageMode(PageMode mode); PageLayout getPageLayout(); void setPageLayout(PageLayout layout); PDURIDictionary getURI(); void setURI(PDURIDictionary uri); PDStructureTreeRoot getStructureTreeRoot(); void setStructureTreeRoot(PDStructureTreeRoot treeRoot); String getLanguage(); void setLanguage(String language); String getVersion(); void setVersion(String version); PDPageLabels getPageLabels(); void setPageLabels(PDPageLabels labels); PDOptionalContentProperties getOCProperties(); void setOCProperties(PDOptionalContentProperties ocProperties); }
PDDocumentCatalog implements COSObjectable { public PDPageLabels getPageLabels() throws IOException { COSDictionary dict = (COSDictionary) root.getDictionaryObject(COSName.PAGE_LABELS); return dict == null ? null : new PDPageLabels(document, dict); } PDDocumentCatalog(PDDocument doc);  PDDocumentCatalog(PDDocument doc, COSDictionary rootDictionary); COSDictionary getCOSObject(); PDAcroForm getAcroForm(); void setAcroForm(PDAcroForm acroForm); PDPageTree getPages(); PDViewerPreferences getViewerPreferences(); void setViewerPreferences(PDViewerPreferences prefs); PDDocumentOutline getDocumentOutline(); void setDocumentOutline(PDDocumentOutline outlines); List<PDThread> getThreads(); void setThreads(List threads); PDMetadata getMetadata(); void setMetadata(PDMetadata meta); void setOpenAction(PDDestinationOrAction action); PDDestinationOrAction getOpenAction(); PDDocumentCatalogAdditionalActions getActions(); void setActions(PDDocumentCatalogAdditionalActions actions); PDDocumentNameDictionary getNames(); PDDocumentNameDestinationDictionary getDests(); void setNames(PDDocumentNameDictionary names); PDMarkInfo getMarkInfo(); void setMarkInfo(PDMarkInfo markInfo); List<PDOutputIntent> getOutputIntents(); void addOutputIntent(PDOutputIntent outputIntent); void setOutputIntents(List<PDOutputIntent> outputIntents); PageMode getPageMode(); void setPageMode(PageMode mode); PageLayout getPageLayout(); void setPageLayout(PageLayout layout); PDURIDictionary getURI(); void setURI(PDURIDictionary uri); PDStructureTreeRoot getStructureTreeRoot(); void setStructureTreeRoot(PDStructureTreeRoot treeRoot); String getLanguage(); void setLanguage(String language); String getVersion(); void setVersion(String version); PDPageLabels getPageLabels(); void setPageLabels(PDPageLabels labels); PDOptionalContentProperties getOCProperties(); void setOCProperties(PDOptionalContentProperties ocProperties);  }