Closed Bug 2043736 Opened 4 days ago Closed 3 days ago

Update PDF.js to new version 19d95c8fee37e4350c11a1c13d20e16a29719582 from 2026-05-29 19:09:24

Categories

(Firefox :: PDF Viewer, enhancement)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 2043824
Tracking Status
firefox153 --- affected

People

(Reporter: update-bot, Assigned: calixte)

References

(Blocks 1 open bug)

Details

(Whiteboard: [3pl-filed][task_id: Z4P4wmoJRJyvX0vW0Bencw])

Attachments

(1 obsolete file)

This update covers 15 commits. Here are the overall diff statistics, and then the commit information.


toolkit/components/pdfjs/PdfJsDefaultPrefs.js | 1 +
toolkit/components/pdfjs/content/build/pdf.mjs | 27 +-
toolkit/components/pdfjs/content/build/pdf.scripting.mjs | 4 +-
toolkit/components/pdfjs/content/build/pdf.worker.mjs | 985 +++++++++++--
toolkit/components/pdfjs/content/web/viewer-geckoview.mjs | 22 +-
toolkit/components/pdfjs/content/web/viewer.html | 2 +-
toolkit/components/pdfjs/content/web/viewer.mjs | 144 +-
toolkit/components/pdfjs/moz.yaml | 4 +-
8 files changed, 967 insertions(+), 222 deletions(-)


b9b7661e649de3abfecc7189999f439333c8cd96 by Tim van der Meij <timvandermeij@gmail.com>

https://github.com/mozilla/pdf.js/commit/b9b7661e649de3abfecc7189999f439333c8cd96
Authored: 2026-05-25 15:30:54 +0200
Committed: 2026-05-29 20:24:42 +0200

Upgrade Puppeteer to version 25.1.0

This is a major version bump, but the changelog at
https://github.com/puppeteer/puppeteer/releases/tag/puppeteer-core-v25.0.0
doesn't indicate any breaking changes that should impact us.

Moreover, this release contains the fix for the memory leak from
puppeteer/puppeteer#14876, so we can remove
the workaround related to that now.

Finally, we rename .puppeteerrc to .puppeteerrc.json because of
https://github.com/puppeteer/puppeteer/issues/15076, but in general it's
a good idea to be explicit about the file format via its extension, so
even if this upstream bug is fixed we don't need to revert this.

Files Modified:

  • gulpfile.mjs
  • package-lock.json
  • package.json

Files Changed:

  • R100 .puppeteerrc

8d5fe521b39baeaf589e460d6bc5f1a75704a157 by Tim van der Meij <timvandermeij@gmail.com>

https://github.com/mozilla/pdf.js/commit/8d5fe521b39baeaf589e460d6bc5f1a75704a157
Authored: 2026-05-29 19:16:17 +0200
Committed: 2026-05-29 19:24:31 +0200

Fix missing non-zero exit code for failure cases in test.mjs

The two affected code paths caught and logged errors, but that wasn't
reflected in the exit code of the process, and that is what GitHub
Actions (and other tools) to determine if process execution was
successful or not. This commit fixes the issue by making sure we
consistently exit with code 1 in case of errors so that GitHub Actions
pipelines correctly reflect the outcome of the test run.

Files Modified:

  • test/test.mjs

fc6e19b9cb250461fe8a1ec84715e38444ee0729 by github-actions[bot] <github-actions[bot]@users.noreply.github.com>

https://github.com/mozilla/pdf.js/commit/fc6e19b9cb250461fe8a1ec84715e38444ee0729
Authored: 2026-05-29 00:55:59 +0000
Committed: 2026-05-29 00:55:59 +0000

l10n: Update locale files

Files Modified:

  • l10n/ar/viewer.ftl
  • l10n/hy-AM/viewer.ftl

600986b51d41175d9640cd58e4a88cca94d547c6 by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/600986b51d41175d9640cd58e4a88cca94d547c6
Authored: 2026-05-25 18:16:29 +0200
Committed: 2026-05-28 22:11:13 +0200

Allow inserting an image as a new page when editing a PDF

Image files dropped on or selected via the thumbnail viewer's
"add file" picker are now accepted alongside PDFs and inserted
as synthetic pages sized to the document's modal page dimensions.

The image-encoding helper previously embedded in StampAnnotation has
moved to src/core/editor/pdf_images.js so it can be shared between
stamp annotations and page synthesis.

Files Added:

  • src/core/editor/pdf_images.js

Files Modified:

  • src/core/annotation.js
  • src/core/document.js
  • src/core/editor/pdf_editor.js
  • src/core/worker.js
  • src/core/writer.js
  • src/display/api.js
  • test/integration/reorganize_pages_spec.mjs
  • test/unit/api_spec.js
  • test/unit/stream_spec.js
  • web/pdf_thumbnail_viewer.js
  • web/viewer.html

45cdb5d3e848d9fcb2d83dd76e36cd47bd0b6b63 by Titus Wormer <tituswormer@gmail.com>

https://github.com/mozilla/pdf.js/commit/45cdb5d3e848d9fcb2d83dd76e36cd47bd0b6b63
Authored: 2026-05-07 13:30:41 +0200
Committed: 2026-05-28 10:30:37 +0200

Add support for encrypted attachments

This PR is related to GH-20732, which is about AuthEvent (to delay
promting for a password), but instead adds the actual support for
encrypted attachments.
“Encrypted attachments” means that the main things are plain text.
Note that some PDF viewers, like Preview/QuickLook/Safari or Chrome,
do not support attachments at all.
Note that the file checked into the tests is the same as
output-no-auth-event.pdf referenced in
https://github.com/mozilla/pdf.js/issues/20139#issuecomment-3952462166.

Closes GH-20139.

Files Added:

  • test/pdfs/encrypted-attachment.pdf

Files Modified:

  • src/core/crypto.js
  • src/core/parser.js
  • test/pdfs/.gitignore
  • test/unit/api_spec.js

a33e06cafb5d4183e69dd068a69003d3018cb846 by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/a33e06cafb5d4183e69dd068a69003d3018cb846
Authored: 2026-05-26 22:36:46 +0200
Committed: 2026-05-26 22:36:50 +0200

Use a black backdrop for Luminosity SMasks when /BC is missing

It fixes #21346.

Files Added:

  • test/pdfs/issue21346.pdf

Files Modified:

  • src/core/evaluator.js
  • test/pdfs/.gitignore
  • test/test_manifest.json

8666bca8ae564684a9d61dac79062845c2a13d1b by dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

https://github.com/mozilla/pdf.js/commit/8666bca8ae564684a9d61dac79062845c2a13d1b
Authored: 2026-05-26 19:41:27 +0000
Committed: 2026-05-26 19:41:27 +0000

Bump codecov/codecov-action from 6.0.0 to 6.0.1

Bumps codecov/codecov-action from 6.0.0 to 6.0.1.


updated-dependencies:

  • dependency-name: codecov/codecov-action
    dependency-version: 6.0.1
    dependency-type: direct:production
    update-type: version-update:semver-patch
    ...

Signed-off-by: dependabot[bot] <support@github.com>

Files Modified:

  • .github/workflows/ci.yml
  • .github/workflows/font_tests.yml
  • .github/workflows/integration_tests.yml
  • .github/workflows/unit_tests.yml

e1ddc6614bbb9d719da1c77c97e74f66104f510d by dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

https://github.com/mozilla/pdf.js/commit/e1ddc6614bbb9d719da1c77c97e74f66104f510d
Authored: 2026-05-26 19:41:13 +0000
Committed: 2026-05-26 19:41:13 +0000

Bump github/codeql-action from 4.35.4 to 4.35.5

Bumps github/codeql-action from 4.35.4 to 4.35.5.


updated-dependencies:

  • dependency-name: github/codeql-action
    dependency-version: 4.35.5
    dependency-type: direct:production
    update-type: version-update:semver-patch
    ...

Signed-off-by: dependabot[bot] <support@github.com>

Files Modified:

  • .github/workflows/codeql.yml

385b1ca4127edb1ee8f085f9c1ba5045ce1cd725 by calixteman <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/385b1ca4127edb1ee8f085f9c1ba5045ce1cd725
Authored: 2026-05-26 21:08:26 +0200
Committed: 2026-05-26 21:24:51 +0200

Clamp out-of-range BlueScale to Adobe's valid window

Fonts that ship a BlueScale outside the range AFDKO considers valid
for their zone heights (0.5/maxZoneHeight <= BlueScale <= 1/maxZoneHeight)
cause Firefox's CFF rasterizer to misalign overshooting glyphs against
flat-topped ones at body sizes.
Clamp into that window, only apply the lower clamp when BlueScale is
also smaller than the default, so foundry fonts that pair the default
0.039625 with small zones are untouched.

Fixes #9437.

Files Modified:

  • src/core/cff_parser.js
  • test/unit/cff_parser_spec.js

6d8d6f13494388da0e14a840eaf2777451aba484 by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/6d8d6f13494388da0e14a840eaf2777451aba484
Authored: 2026-05-26 21:00:25 +0200
Committed: 2026-05-26 21:00:25 +0200

Revert "Remove unused variables with the Babel plugin"

Files Deleted:

  • external/builder/fixtures_babel/unused-variable-expected.js
  • external/builder/fixtures_babel/unused-variable.js

Files Modified:

  • external/builder/babel-plugin-pdfjs-preprocessor.mjs
  • external/builder/fixtures_babel/constants-expected.js
  • external/builder/fixtures_babel/constants.js
  • external/builder/fixtures_babel/constructors-expected.js
  • external/builder/fixtures_babel/constructors.js
  • external/builder/fixtures_babel/deadcode-expected.js
  • external/builder/fixtures_babel/deadcode.js
  • external/builder/fixtures_babel/evals-expected.js
  • external/builder/fixtures_babel/evals.js

e1de5c30b5d422f65ea95a86f8c7a56e6bafe0e9 by calixteman <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/e1de5c30b5d422f65ea95a86f8c7a56e6bafe0e9
Authored: 2026-05-24 22:37:51 +0200
Committed: 2026-05-26 17:49:56 +0200

Parse CID-keyed Type 1 fonts instead of falling back to a system font

It fixes #15292.

PDFs can embed a CID-keyed Type 1 program (Adobe TechNote 5014,
CIDFontType 0) under /Subtype /CIDFontType0 + /FontFile. Its binary
CIDMap/SubrMap layout has no eexec block, so Type1Font's eexec-only
parser used to fall through and trigger the work-around added in
PR #15397.
Split the constructor and parse the binary CIDMap, SubrMap
and charstrings (encrypted with the standard Type 1 charstring cipher)
through the existing Type1CharString.convert + CFF wrap pipeline.

Only single-FDArray fonts are supported; the StartData length is
clamped to the stream's remaining bytes before allocating.

Files Modified:

  • src/core/type1_font.js
  • src/core/type1_parser.js
  • test/unit/type1_parser_spec.js

2691868904762bbbacaa89fdf2ded8e9cc430b87 by Nicolò Ribaudo <nribaudo@igalia.com>

https://github.com/mozilla/pdf.js/commit/2691868904762bbbacaa89fdf2ded8e9cc430b87
Authored: 2026-05-26 14:37:40 +0200
Committed: 2026-05-26 16:35:57 +0200

Remove unused variables with the Babel plugin

  • functions were already removed
  • variables can be removed when their initializer does not have side effects
  • classes can be removed when they have no static blocks

Fixes #21337

Files Added:

  • external/builder/fixtures_babel/unused-variable-expected.js
  • external/builder/fixtures_babel/unused-variable.js

Files Modified:

  • external/builder/babel-plugin-pdfjs-preprocessor.mjs
  • external/builder/fixtures_babel/constants-expected.js
  • external/builder/fixtures_babel/constants.js
  • external/builder/fixtures_babel/constructors-expected.js
  • external/builder/fixtures_babel/constructors.js
  • external/builder/fixtures_babel/deadcode-expected.js
  • external/builder/fixtures_babel/deadcode.js
  • external/builder/fixtures_babel/evals-expected.js
  • external/builder/fixtures_babel/evals.js

927da8c78eaf1fee2c980e92d9ff79d04f923e7f by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/927da8c78eaf1fee2c980e92d9ff79d04f923e7f
Authored: 2026-05-26 15:12:22 +0200
Committed: 2026-05-26 15:12:22 +0200

Run unit-tests and integration-tests when the external/builder/ folder is changed

Given that changes to either the Babel plugin or the "old" builder could accidentally cause issues in the built files, it seems like a good idea to run all test-suites when the external/builder/ folder is changed.

Files Modified:

  • .github/workflows/integration_tests.yml
  • .github/workflows/unit_tests.yml

6b92ad59240f387e852e92af7167cf577c94aee3 by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/6b92ad59240f387e852e92af7167cf577c94aee3
Authored: 2026-05-25 20:27:50 +0200
Committed: 2026-05-25 21:09:42 +0200

Allow merging several PDFs at once via the picker or drag-and-drop

Files Modified:

  • test/integration/reorganize_pages_spec.mjs
  • web/pdf_thumbnail_viewer.js
  • web/viewer.html

567f585defce102d9dd4aaded5635f358757bf14 by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/567f585defce102d9dd4aaded5635f358757bf14
Authored: 2026-05-20 18:37:26 +0200
Committed: 2026-05-25 15:42:19 +0200

Add a pref-controlled method to notify embedders that mozPrintCallback has completed (bug 2036265)

Adds a postMessageAfterPrintCallback browser option (off by default).
When enabled by Firefox, the print service posts "ready" or "error" to
the window after each page's mozPrintCallback resolves, so embedders
(e.g. print-preview test harnesses) can observe when rendering is done.

Upstreams the viewer-side portion of Phabricator D297837.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Daniel Holbert <dholbert@cs.stanford.edu>

Files Modified:

  • web/app_options.js
  • web/firefox_print_service.js

Duplicate of this bug: 2043581

All the jobs in the try run succeeded. Like literally all of them, there weren't
even any intermittents. That is pretty surprising to me, so maybe you should double
check to make sure I didn't misinterpret things and that the correct tests ran...

Anyway, I've done all I can, so I'm passing to you to review and land the patch.
When reviewing, please note that this is external code, which needs a full and
careful inspection - not a rubberstamp.

Assignee: nobody → cdenizet

This bug is being closed because a newer revision of the library is available.
This bug will be marked as a duplicate of it (because although this bug is older, it is superseded by the newer one).

Status: NEW → RESOLVED
Closed: 3 days ago
Duplicate of bug: 2043824
Resolution: --- → DUPLICATE
Attachment #9591681 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: