[
https://issues.apache.org/jira/browse/PDFBOX-2793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14537672#comment-14537672
]
Tilman Hausherr commented on PDFBOX-2793:
-----------------------------------------
I noticed that PDDocumentNameDictionary had some support for a catalog level
/Dests entry, which is why it keeps the catalog as a field. But it didn't work
even after getting rid of an NPE in the code, I ended up getting no result and
a warning {code}NameTreeNode does not have "names" nor "kids" objects.{code}
The two /Dests entries are just not the same. So creating a new class is IMHO
the correct solution, especially considering that it correctly runs this code
on the users file:
{code}
PDFTextStripper stripper = new PDFTextStripper();
PDDocumentOutline documentOutline =
documentCatalog.getDocumentOutline();
PDOutlineItem firstChild = documentOutline.getFirstChild();
PDOutlineItem secondChild = firstChild.getNextSibling();
PDOutlineItem thirdChild = firstChild.getNextSibling();
stripper.setStartBookmark(secondChild);
stripper.setEndBookmark(thirdChild);
System.out.println(stripper.getText(doc));
{code}
> /Dests dictionary isn't supported
> ---------------------------------
>
> Key: PDFBOX-2793
> URL: https://issues.apache.org/jira/browse/PDFBOX-2793
> Project: PDFBox
> Issue Type: Bug
> Components: PDModel
> Affects Versions: 1.8.9, 1.8.10, 2.0.0
> Reporter: Tilman Hausherr
> Assignee: Tilman Hausherr
> Fix For: 1.8.10, 2.0.0
>
>
> I have received a non public file that has a /Dests dictionary in the
> /Catalog, and this is not supported by PDFBox. This is a concept from PDF 1.1
> that is no longer used since PDF 1.2, but it is legal and not deprecated,
> only discouraged.
> What needs to be done is to include an additional lookup in
> PDOutlineItem.findDestinationPage() in the PDNamedDestination section. And an
> additional getter in PDDocumentCatalog, and a new class to encapsulate that
> "dictionary of names and corresponding destinations".
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]