Skip to content

[Bug]: UnknownErrorException 'kidDict.getRaw is not a function' #19694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gsamokovarov opened this issue Mar 20, 2025 · 1 comment · Fixed by #19702
Closed

[Bug]: UnknownErrorException 'kidDict.getRaw is not a function' #19694

gsamokovarov opened this issue Mar 20, 2025 · 1 comment · Fixed by #19702

Comments

@gsamokovarov
Copy link

gsamokovarov commented Mar 20, 2025

Attach (recommended) or Link to PDF file

I cannot share the document that this happens to as it belongs to a customer, I'll try to get back to you with a reproducible document.

Web browser and its version

'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36'

Operating system and its version

macPS

PDF.js version

4.10.38

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

I get a runtime error for certain documents during rendering: kidDict.getRaw is not a function. However, the document renders and works "just fine" for my needs.

I have tried to debug the error a bit and it happens on this line, because the line above kidDict = this.dict.xref.fetch(kid) returns a number, 1 in my case, and not a Dict object. I haven't followed the code enough to know what the number means, but it's certainly not the Dict object we expect in the code path.

Image

What is the expected behavior?

Not to issue a runtime error.

What went wrong?

Nothing, as far as I can see. There may be broken functionality we don't use, I dunno.

Link to a viewer

No response

Additional context

No response

@calixteman
Copy link
Contributor

Without a pdf it's impossible to guess what's wrong.
If your pdf is too much private to be attached there but if it's acceptable I can see it, you can send it to me on my pro email.
For your information I'm the triage owner of the pdf component for Firefox: https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox&component=PDF%20Viewer.

calixteman added a commit that referenced this issue Mar 25, 2025
In the struct tree a kid can be a reference to an MCID entry (issue #19694)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants