[Bug]: `/GoToE` doesn’t work descendants other than children
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 53.9k
- Forks
- 10.7k
- Avg merge
- 18h 38m
- Merged PRs (30d)
- 130
Description
Attach (recommended) or Link to PDF file
Web browser and its version
Firefox 155.0
Operating system and its version
Fedora 43
PDF.js version
6.4.146 [88f604494]
Is the bug present in the latest PDF.js version?
Yes
Is a browser extension
No
Steps to reproduce the problem
- Document contains two links to embedded files.
- Red circle on the left goes to the child (green circle): works fine.
- Green circle with blue circle inside (on the right) goes to the green child: works wrong, since the grandchild is a blue circle.
Just to explain the structure:
- Main file (
red.pdf).- Embedded file in main file (
green.pdf).- Embedded file in embedded file (
blue.pdf).
- Embedded file in embedded file (
- Embedded file in main file (
What is the expected behavior?
The link to grandchild should work fine (the link on the right should go to blue.pdf, not to green.pdf).
/GoToE to other descendants than children should work fine.
What went wrong?
Link to embedded grandchild (going to blue.pdf):
6 0 obj
<<
/D [ 0 /Fit ]
/S /GoToE
/T <<
/N (green.pdf)
/R /C
/T <<
/N (blue.pdf)
/R /C
>>
>>
>>
endobj
This was read as (went to green.pdf):
6 0 obj
<<
/D [ 0 /Fit ]
/S /GoToE
/T <<
/N (green.pdf)
/R /C
>>
>>
endobj
Link to a viewer
No response
Additional context
Acrobat Reader opens the link to the grandchild fine.
Many thanks for your help.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the attached red.pdf in the PDF.js viewer, focusing on /GoToE handling for nested embedded files. Compare the shown /T chain for green.pdf and blue.pdf; done means the link reaches blue.pdf rather than stopping at green.pdf.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100