Open almogyehuda opened 9 months ago
Also faced with this issue, solved by adding @pdf-lib/standard-fonts to the dependencies and import '@pdf-lib/standard-fonts';
to the file where I use pdf-lib
Also faced with this issue, solved by adding @pdf-lib/standard-fonts to the dependencies and
import '@pdf-lib/standard-fonts';
to the file where I use pdf-lib
YOU, sir, have saved my life and my sanity. Days lost, hours on google, and here lies this simple, elegant solution. Blessings be upon your house.
What were you trying to do?
Enumerate on indirect objects
How did you attempt to do it?
const pdfDoc = await PDFDocument.load(buffer); pdfDoc.context.enumerateIndirectObjects()
What actually happened?
ReferenceError: Encoding is not defined
What did you expect to happen?
Not to throw exception.
How can we reproduce the issue?
I have a small express.js server, reading a PDF file and trying to load it with pdf-lib. the server is running in docker container. When running outside the docker container - seems to work fine.
Version
1.17.1
What environment are you running pdf-lib in?
Node
Checklist
Additional Notes
No response