[Bug]: `/GoToE` links not working when `/R /P` (relation is child)
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
hypgotoe-example.pdf contains an embedded PDF document and /GoToE links from parent to child and from child back to parent.
Links with target related as child work as expected, but there are two links from child (actually, it is https://github.com/user-attachments/files/25358383/hypgotoe-example.pdf#ef=hypgotoe-child.pdf (only works with #20671 implemented) to parent that don’t work.
These are the following objects (from hypgotoe-child.pdf):
12 0 obj
<<
/Type /Annot
/Border [ 0 0 1 ]
/H /I
/C [ 0 1 1 ]
/Rect [ 132.772 632.481 285.74 643.329 ]
/Subtype /Link
/A <<
/Type /Action
/S /GoToE
/D (page.1)
/T <<
/R /P
>>
>>
>>
endobj
13 0 obj
<<
/Type /Annot
/Border [ 0 0 1 ]
/H /I
/C [ 0 1 1 ]
/Rect [ 132.772 620.526 297.336 631.374 ]
/Subtype /Link
/A <<
/Type /Action
/S /GoToE
/D (page.2)
/T <<
/R /P
>>
>>
>>
endobj
Web browser and its version
147.0.3
Operating system and its version
Fedora 43
PDF.js version
the one that comes with Firefox 147.0.3.
Is the bug present in the latest PDF.js version?
Yes
Is a browser extension
No
Steps to reproduce the problem
-
Open
hypgotoe-example.pdf. -
Click any link that goes to embedded file.
-
Try to click any of the links from the child document to the main one.
What is the expected behavior?
Links in hypgotoe-child.pdf to parent should back to main document as intended.
What went wrong?
Links from child (embedded document) to parent (main document) don’t work.
Link to a viewer
No response
Additional context
hypgotoe-child.pdf validates perfectly fine against the current Arlington model.
Example 2 from printed page 421 of the PDF-1.7 spec) contains:
2 0 obj
<< /Type /Action
/S /GoToE
/D (Chapter 1)
/T << /R /P >>
>>
endobj
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
Reproduce the failure with the attached hypgotoe-example.pdf by opening the embedded hypgotoe-child.pdf and following its /GoToE links with /R /P. Trace the handling of those child-to-parent links and verify that both targets navigate back to the main document as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100