[ https://issues.apache.org/jira/browse/PDFBOX-5975?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17936898#comment-17936898 ]
Frans Bouwmans commented on PDFBOX-5975: ---------------------------------------- It is in a very large file (over 3000 pages and > 270MB). There are 4 occurances of this problem. I cannot share the file and I tried to extract the page using nitro, after which the problem is gone (i.e. the named destination is likely not copied to the target file). The file opens fine in edge, adobe, and nitro. Is there a way that I can inspect the pdf with the PDFDebugger? I'm not sure where these PDDestinations are hidden. I do note that when I add a check before the cast and in case if incorrect class return a null, that the debugger renders the page fine. > Class cast exception in building PDDestinationNameTreeNode > ---------------------------------------------------------- > > Key: PDFBOX-5975 > URL: https://issues.apache.org/jira/browse/PDFBOX-5975 > Project: PDFBox > Issue Type: Bug > Affects Versions: 3.0.4 PDFBox > Environment: Windows > Reporter: Frans Bouwmans > Priority: Major > > In PDDestinationNameTreeNode.java on line 63 a PDDestination is created. > This function returns a PDDestination which is then casted to a > PDPageDestination. > There is however also a PDDestination of type PDNamedDestination. > When a page is opened of a document with a named destination and the > destination tree node is created, such as on rendering or using the splitter, > then just opening the page will fail with a class cast exception and the page > can therefore not be rendered, and is not included in a split document. > A test with a check of the instance type and return null does at least fix > the exception. > It is not clear whether named destinations should be handled here or ignored. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org