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

ReferenceError: Encoding is not defined #1582

Open
2 tasks done
almogyehuda opened this issue Jan 3, 2024 · 2 comments
Open
2 tasks done

ReferenceError: Encoding is not defined #1582

almogyehuda opened this issue Jan 3, 2024 · 2 comments

Comments

@almogyehuda
Copy link

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

  • My report includes a Short, Self Contained, Correct (Compilable) Example.
  • I have attached all PDFs, images, and other files needed to run my SSCCE.

Additional Notes

No response

@maradondt
Copy link

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

@sleeptil3
Copy link

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.

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

No branches or pull requests

3 participants