Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unpdf can't render pages with images #4

Closed
DemoMacro opened this issue Dec 25, 2023 · 1 comment
Closed

Unpdf can't render pages with images #4

DemoMacro opened this issue Dec 25, 2023 · 1 comment

Comments

@DemoMacro
Copy link

Environment

Node.js v20.9.0
PNPM v8.10.0
UnPDF v0.10.0

Reproduction

Example Code: CodeSandBox

Describe the bug

When I am ready to render a page with unpdf, renderPageAsImage will report an error if there is an image embedded in the pdf.

Additional context

No response

Logs

TypeError: r.createCanvas is not a function
    at NodeCanvasFactory._createCanvas (file:///workspaces/workspace/node_modules/.pnpm/unpdf@0.10.0/node_modules/unpdf/dist/pdfjs.mjs:1:1316062)
    at NodeCanvasFactory.create (file:///workspaces/workspace/node_modules/.pnpm/unpdf@0.10.0/node_modules/unpdf/dist/pdfjs.mjs:1:1153693)
    at CachedCanvases.getCanvas (file:///workspaces/workspace/node_modules/.pnpm/unpdf@0.10.0/node_modules/unpdf/dist/pdfjs.mjs:1:1163909)
    at CanvasGraphics.paintInlineImageXObject (file:///workspaces/workspace/node_modules/.pnpm/unpdf@0.10.0/node_modules/unpdf/dist/pdfjs.mjs:1:1198408)
    at CanvasGraphics.paintImageXObject (file:///workspaces/workspace/node_modules/.pnpm/unpdf@0.10.0/node_modules/unpdf/dist/pdfjs.mjs:1:1197232)
    at CanvasGraphics.executeOperatorList (file:///workspaces/workspace/node_modules/.pnpm/unpdf@0.10.0/node_modules/unpdf/dist/pdfjs.mjs:1:1172983)
    at InternalRenderTask._next (file:///workspaces/workspace/node_modules/.pnpm/unpdf@0.10.0/node_modules/unpdf/dist/pdfjs.mjs:1:1152632)
@johannschopplich
Copy link
Collaborator

Thanks a lot for the reproduction. Merry Christmas, still! 🎄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants