You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a simple REST API which takes a base64 image (png/jpg) and embeds that on a pdf. I am using yarn as a package manager, and Node v20.13.1, TypeScript, and ExpressJS as tech stack.
How did you attempt to do it?
Here's a sample code which is exactly similar to one of the example provided in the README.md
const { PDFDocument, rgb } = PDFLib
What were you trying to do?
I have a simple REST API which takes a base64 image (png/jpg) and embeds that on a pdf. I am using
yarn
as a package manager, and Node v20.13.1, TypeScript, and ExpressJS as tech stack.How did you attempt to do it?
Here's a sample code which is exactly similar to one of the example provided in the
README.md
const { PDFDocument, rgb } = PDFLib
What actually happened?
The error happens on this line
pdfDoc.embedPng(imageBytes)
There's a
UPNG.decode is not a function
error when I am embedding a png (ArrayBuffers) on the page.What did you expect to happen?
I expect the image to be embeded into the pdf at the given co-ordinates without any errors.
How can we reproduce the issue?
I have shared the code above. Would be happy to provide more info if needed
CodeSandbox if that helps
Version
2.2.4
What environment are you running pdf-lib in?
Node
Checklist
Additional Notes
No response
The text was updated successfully, but these errors were encountered: