Skip to content

[pull] master from mozilla:master#415

Merged
pull[bot] merged 7 commits into
code:masterfrom
mozilla:master
Jun 14, 2026
Merged

[pull] master from mozilla:master#415
pull[bot] merged 7 commits into
code:masterfrom
mozilla:master

Conversation

@pull

@pull pull Bot commented Jun 14, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

Snuffleupagus and others added 7 commits June 13, 2026 13:14
…ata`

This removes a little bit of code duplication, which only exist since the `src/display/canvas.js` code pre-dates the helper function by many years.

Note: Given that `OffscreenCanvas` is enabled by default there's currently not a lot of test coverage for this code-path, hence the added browser-test.
Currently when opening a PDF document the following code is used, where `checkFirstPage`/`checkLastPage` helps detect XRef corruption; note https://github.com/mozilla/pdf.js/blob/86a18bd5fec4261f28485f3ac854f118d04a5671/src/core/worker.js#L167-L176

However when merging a PDF into an existing document the parsing is only "partial"; note https://github.com/mozilla/pdf.js/blob/86a18bd5fec4261f28485f3ac854f118d04a5671/src/core/worker.js#L632-L634

It seems a little strange to not support corrupt PDFs in a consistent manner in the code-base, hence this patch adds a new `BasePdfManager` helper that handles all the relevant parsing/checking and re-uses that when merging PDFs.
Add an integration-test for merging a corrupt PDF
The "Merge PDF" integration-tests will (indirectly) invoke `PDFViewerApplication.open` as part of loading the new PDF document, which will end up creating a new `PDFWorker` instance.
Currently worker coverage is only collected at the end of each integration-test, which means that in these cases we miss the coverage data from any "previous" workers.
Add an integration-test for merging a password-protected PDF
…rtRGBToRGBA

Use the `convertRGBToRGBA` helper with RGB images in `putBinaryImageData`
@pull pull Bot locked and limited conversation to collaborators Jun 14, 2026
@pull pull Bot added the ⤵️ pull label Jun 14, 2026
@pull pull Bot merged commit ed1b2f9 into code:master Jun 14, 2026
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
@pull pull Bot had a problem deploying to code-coverage June 14, 2026 14:03 Failure
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants