Skip to content

build(deps): bump unpdf from 1.9.1 to 2.1.0 - #310

Merged
Kikobeats merged 6 commits into
masterfrom
dependabot/npm_and_yarn/unpdf-2.1.0
Nov 2, 2026
Merged

Kikobeats merged 6 commits into
masterfrom
dependabot/npm_and_yarn/unpdf-2.1.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Nov 2, 2026

Copy link
Copy Markdown
Contributor

Bumps unpdf from 1.9.1 to 2.1.0.

Release notes

Sourced from unpdf's releases.

v2.1.0

   🚀 Features

   🐞 Bug Fixes

    View changes on GitHub

v2.0.1

   🐞 Bug Fixes

    View changes on GitHub

v2.0.0

unpdf 2.0 is here! 🎉

This major release extracts every image on a page, adds page inspection and more rendering formats, and trims the API. unpdf now ships as ESM only and requires Node.js 24.

🔥 What's New

  • Complete image extraction – extractImages returns inline images and image masks too, as RGBA pixels or as PNG with format: 'png', each with its position on the page in bounds.
  • Page inspection – inspectPages measures text and image coverage per page, e.g. to tell scanned pages from born-digital ones.
  • JPEG and WebP rendering – renderPageAsImage takes format: 'png' | 'jpeg' | 'webp' and a quality.
  • CMaps and standard fonts in Node.js – with pdfjs-dist installed, both load from that package, so CJK text without embedded mappings extracts correctly.
  • Typed metadata – getMeta types the /Info dictionary as PDFInfo.

🚀 How to Upgrade

pnpm add unpdf@^2

unpdf 2 requires Node.js 24 or later. CommonJS builds are gone – replace require('unpdf') with import. The steps below cover every other breaking change.

1. Define PDF.js Without await

definePDFJSModule stores the loader and loads PDF.js on first use. configureUnPDF and resolvePDFJSImport are removed.

- await configureUnPDF({ pdfjs: () => import('pdfjs-dist/legacy/build/pdf.mjs') })
+ definePDFJSModule(() => import('pdfjs-dist/legacy/build/pdf.mjs'))

A loader that fails now throws on the first call of another method. To load PDF.js up front, call await getResolvedPDFJS() where you used resolvePDFJSImport().

... (truncated)

Commits
  • c612f83 chore: release v2.1.0
  • d049048 fix: hand pdfjs-dist its image decoders in getDocumentProxy
  • ea398d6 feat: export registerImageDecoders and keep the image decoders out of text-...
  • 94d6425 chore: release v2.0.1
  • 2a3d514 fix: decode CCITT, JBIG2, and JPEG 2000 images in every runtime (#72)
  • 2cc485c test: load @napi-rs/canvas before any test times out
  • ce13da0 chore: release v2.0.0
  • 173112a chore: update dependencies
  • bcf5270 fix: accept RenderPageAsImageOptions in renderPageAsImage and export `Met...
  • 1a382ad refactor: trim single-use helpers and dead code
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [unpdf](https://github.com/unjs/unpdf) from 1.9.1 to 2.1.0.
- [Release notes](https://github.com/unjs/unpdf/releases)
- [Commits](unjs/unpdf@v1.9.1...v2.1.0)

---
updated-dependencies:
- dependency-name: unpdf
  dependency-version: 2.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Nov 2, 2026
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3fdcee7d-6a77-45b4-9d43-892be55c5b60

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

html-get

Details
Benchmark suite Current: b2b35e0 Previous: 74b8e6e Ratio
html rewriteUrls off 167.7 ms (161.7-177.1) 171 ms (167.4-175.4) 0.98
html rewriteUrls on 256 ms (244.6-270.7) 259 ms (252.1-269.7) 0.99
pdf extract 134.2 ms (123.6-159.9) 126 ms (122.9-130.3) 1.07
cold require 315.4 ms (312.8-326.1) 320.1 ms (311.9-326.3) 0.99

This comment was automatically generated by workflow using github-action-benchmark.

Kikobeats and others added 5 commits November 2, 2026 11:18
unpdf 2 dropped the `channels` field from `extractImages` and always
returns RGBA pixels, so `usable()` filtered every image out and every
PDF lost its `image` and `logo`. Encode RGBA and stop reading `channels`.

unpdf 2 also returns image masks, which have no color of their own and
come out opaque black on transparent. Reject those stencils by their
pixels, so a PDF keeps the logo it had on unpdf 1.

Checked against the 53 PDF fixtures: the 46 images unpdf 1.9.1 extracted
are byte-identical in RGBA on 2.1.0, and every chosen image and logo is
the same one. Snapshot diffs are the PNG length only (RGB -> RGBA).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A PNG stride that only covers RGB pixels kept the first pixel right
and passed, unseen without the PDF fixtures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
unpdf 2 declares engines `node >=24`, which is now the highest floor in
the dependency tree (was @metascraper/helpers at >= 22.13).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Kikobeats
Kikobeats merged commit e04bbcd into master Nov 2, 2026
4 checks passed
@Kikobeats
Kikobeats deleted the dependabot/npm_and_yarn/unpdf-2.1.0 branch November 2, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant