Skip to content

[Bug]: XFA Layout Error #20296

@srshupe

Description

@srshupe

Attach (recommended) or Link to PDF file

dd1694_1.pdf

Web browser and its version

Chrome 140.0.7339.128, Firefox 143.0.1 (both 64 bit)

Operating system and its version

Windows 11 Enterprise

PDF.js version

5.4.240

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

Yes

Is a browser extension

No

Steps to reproduce the problem

  1. Try to open the document in PDF.js.

What is the expected behavior?

In Adobe, a fillable form appears. On Chrome's PDF viewer, it displays a warning about Javascript not being enabled. Either would be preferable. With PDF.js, there's just a blank screen and an error in the log.

What went wrong?

There is an error in pdf.worker.mjs, in class PageSet, function $getNextPage. The code gets stuck in a loop where it sets this[$extra].pageIndex from 0 to -1, then from -1 to 0, and then back again.

Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
at get children (https://mozilla.github.io/pdf.js/build/pdf.worker.mjs:40104:15)
at PageSet. (https://mozilla.github.io/pdf.js/build/pdf.worker.mjs:44196:54)
at PageArea. (https://mozilla.github.io/pdf.js/build/pdf.worker.mjs:44109:32)
at PageSet. (https://mozilla.github.io/pdf.js/build/pdf.worker.mjs:44199:38)
at PageSet. (https://mozilla.github.io/pdf.js/build/pdf.worker.mjs:44209:34)
at PageArea. (https://mozilla.github.io/pdf.js/build/pdf.worker.mjs:44109:32)
at PageSet. (https://mozilla.github.io/pdf.js/build/pdf.worker.mjs:44199:38)
at PageSet. (https://mozilla.github.io/pdf.js/build/pdf.worker.mjs:44209:34)
at PageArea. (https://mozilla.github.io/pdf.js/build/pdf.worker.mjs:44109:32)
at PageSet. (https://mozilla.github.io/pdf.js/build/pdf.worker.mjs:44199:38)

A different error gets reported to the console. Chrome console:

Uncaught (in promise)
Object { message: can't access property "length", this.dims is undefined, name: "UnknownErrorException", details: TypeError: can't access property "length", this.dims is undefined, stack: "BaseExceptionClosure@https://mozilla.github.io/pdf.js/build/pdf.mjs:419:29\n@https://mozilla.github.io/pdf.js/build/pdf.mjs:422:2\n" }​
details: TypeError: can't access property "length", this.dims is undefined
message: can't access property "length", this.dims is undefined
name: "UnknownErrorException"​
stack: "BaseExceptionClosure@https://mozilla.github.io/pdf.js/build/pdf.mjs:419:29\n@https://mozilla.github.io/pdf.js/build/pdf.mjs:422:2\n"​

​​From XFAFactory.getNumPages(). But the reason that this.dims in undefined is the call stack error above.

Link to a viewer

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions