Description
Section 3.8.6 states that number trees have either "Nums" or "Kids" entries. The current PDPageLabels does not handle Kids and fails with a NPE.
Fix:
public PDPageLabels(PDDocument document, COSDictionary dict) throws IOException
{
this(document);
if (dict == null)
PDNumberTreeNode root = new PDNumberTreeNode(dict, COSDictionary.class);
findLabels(root);
}
private void findLabels(PDNumberTreeNode node) throws IOException {
if (node.getKids() != null) {
@SuppressWarnings("unchecked")
List<PDNumberTreeNode> kids = node.getKids();
for (PDNumberTreeNode kid : kids)
}
else if (node.getNumbers() != null) {
@SuppressWarnings("unchecked")
Map<Integer, COSDictionary> numbers = node.getNumbers();
for (Entry<Integer, COSDictionary> i : numbers.entrySet())
}
}