pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier Cailloux <olivier.caill...@gmail.com>
Subject Get list of PDPageLabelRange?
Date Mon, 24 Apr 2017 12:53:33 GMT
Dear list,
How can I obtain, from a given PDDocument, a list of the page label 
ranges that it contains?

Here is an example where I obtain the first PDPageLabelRange. How to 
retrieve the other ones? I realize I can iterate over all pages of the 
document and query for the possible existence of a pageLabelRange at 
each page, but I suspect there must be a more efficient (and simpler) way.

try (PDDocument document = PDDocument.load(…)) {
     assert !document.isEncrypted();
     PDDocumentCatalog catalog = document.getDocumentCatalog();
     PDPageLabels labels = catalog.getPageLabels();
     PDPageLabelRange pageLabelRange = labels.getPageLabelRange(0);
}

Thanks.
Olivier


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message