Skip to content

[Bug]: Bug in Mozilla PDF.js: Quantity Selection Updates Total for All Rows Instead of a Single Row #18536

Description

@paritosh-mahale

Attach (recommended) or Link to PDF file

Please find document calculation-issue.pdf

I am encountering an issue while using the Mozilla PDF.js library to render PDFs on my webpage. The PDF includes several input fields and formulas. There is a specific problem with the calculation of totals based on the quantity selected from a dropdown menu in the "QTY" column.

Here is a screenshot demonstrating the issue. The total for each row is recalculated incorrectly when the quantity in any row is changed.

iii

Web browser and its version

firefox 127.0

Operating system and its version

Linux

PDF.js version

v4.5.136

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

Yes

Is a browser extension

No

Steps to reproduce the problem

  1. Render the PDF using Mozilla PDF.js on a webpage.
  2. The PDF contains a column labeled "QTY" with a dropdown to select the quantity.
  3. Selecting a quantity value triggers a formula to calculate the total for that row (Total = QTY * Price per).
  4. The expectation is that the total calculation should only affect the row where the quantity was changed.

What is the expected behavior?

When a quantity is selected from the dropdown in the "QTY" column, the total should be calculated only for the corresponding row.

What went wrong?

Changing the quantity in the dropdown causes the total to be recalculated for all rows in the PDF, leading to an incorrect grand total.

Link to a viewer

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions