[ 
https://issues.apache.org/jira/browse/PDFBOX-5975?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17936924#comment-17936924
 ] 

Frans Bouwmans commented on PDFBOX-5975:
----------------------------------------

With a break point on the failure I was able to see the call stack and the 
intermediate nodes. That led me to the entry that has the issue and in the 
debugger it indeed looks different from the one above and below:

I.e. the element highlighted in Blue is the one being retrieved: 

!image-2025-03-19-15-43-48-035.png!

The stack trace as were that happens is the following:

  !image-2025-03-19-15-49-23-060.png!

> 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
>         Attachments: 000334.pdf, image-2025-03-19-15-43-48-035.png, 
> image-2025-03-19-15-49-23-060.png, image-2025-03-19-20-03-09-702.png, 
> screenshot-1.png
>
>
> 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

Reply via email to