Skip to content

Commit 2ec71f4

Browse files
authored
feat: upgrade PDF.js to 5.4.54 (#39)
* feat: upgrade PDF.js to v5.4.54 and refresh lockfile * fix(image): add missing canvas property in page.render()
1 parent c0c8ec7 commit 2ec71f4

File tree

5 files changed

+118
-9
lines changed

5 files changed

+118
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This library is also intended as a modern alternative to the unmaintained but st
1818
## PDF.js Compatibility
1919

2020
> [!Tip]
21-
> The serverless PDF.js bundle provided by `unpdf` is built from PDF.js v5.2.133.
21+
> The serverless PDF.js bundle provided by `unpdf` is built from PDF.js v5.4.54.
2222
2323
You can use an [official PDF.js build](#official-or-legacy-pdfjs-build) by using the [`definePDFJSModule`](#definepdfjsmodule) method. This is useful if you want to use a specific version or a custom build of PDF.js.
2424

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"bumpp": "^10.2.0",
8383
"eslint": "^9.31.0",
8484
"fast-glob": "^3.3.3",
85-
"pdfjs-dist": "~5.2.133",
85+
"pdfjs-dist": "5.4.54",
8686
"rollup": "^4.45.1",
8787
"tslib": "^2.8.1",
8888
"typescript": "^5.8.3",

pnpm-lock.yaml

Lines changed: 114 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/image.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export async function renderPageAsImage(
127127
const drawingContext = (new CanvasFactory()).create(viewport.width, viewport.height)
128128

129129
await page.render({
130+
canvas: drawingContext.canvas as HTMLCanvasElement,
130131
canvasContext: drawingContext.context as CanvasRenderingContext2D,
131132
viewport,
132133
}).promise

test/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe('unpdf', () => {
2929
const PDFJS = await getResolvedPDFJS()
3030
const { version } = PDFJS
3131

32-
expect(version).toMatchInlineSnapshot(`"5.2.133"`)
32+
expect(version).toMatchInlineSnapshot(`"5.4.54"`)
3333
})
3434

3535
it('extracts metadata from a PDF', async () => {

0 commit comments

Comments
 (0)