mozilla / mozilla/pdf.js

[Bug]: `/GoToE` doesn’t work descendants other than children

Open
#21,959 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

core
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

red.pdf

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
  1. Document contains two links to embedded files.
  2. Red circle on the left goes to the child (green circle): works fine.
  3. 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).
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.