You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2015/05/12 20:22:01 UTC
[jira] [Comment Edited] (PDFBOX-2793) /Dests dictionary isn't
supported
[ https://issues.apache.org/jira/browse/PDFBOX-2793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14537672#comment-14537672 ]
Tilman Hausherr edited comment on PDFBOX-2793 at 5/12/15 6:21 PM:
------------------------------------------------------------------
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 = secondChild.getNextSibling();
stripper.setStartBookmark(secondChild);
stripper.setEndBookmark(thirdChild);
System.out.println(stripper.getText(doc));
{code}
was (Author: tilman):
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: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org