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

Fields not readable with Pdf-lib #1705

Open
2 tasks done
gMabdullah opened this issue Nov 29, 2024 · 0 comments
Open
2 tasks done

Fields not readable with Pdf-lib #1705

gMabdullah opened this issue Nov 29, 2024 · 0 comments

Comments

@gMabdullah
Copy link

gMabdullah commented Nov 29, 2024

What were you trying to do?

Trying to read this file for edit.
usmca-certificate-of-origin-form (1).pdf

How did you attempt to do it?

Choose a PDF file <script> const fileInput = document.getElementById("pdf-file-input");pdfDoc = await PDFDocument.load(data); const file = fileInput.files[0]; const pdfDoc = await PDFDocument.load(file.arrayBuffer()); const form = pdfDoc.getForm(); const fields = form.getFields(); console.log("Fields", fields.length); fields?.forEach((field) => { console.log("Fields - name", field.getName();); }); </script>

What actually happened?

By loading the file there are only 3 fields were available by the above snippet but there were nearly 83 fields present on viewing document on Adobe/Foxit Reader or even a browser The file can be provide if required.

File loaded in pdf reader having all 83 fields and editable:
Screenshot 2024-11-30 011256

But by reading with above script;
Screenshot 2024-11-30 011524

What did you expect to happen?

I want to read these fields.

How can we reproduce the issue?

Choose a PDF file <script> const fileInput = document.getElementById("pdf-file-input");pdfDoc = await PDFDocument.load(data); const file = fileInput.files[0]; const pdfDoc = await PDFDocument.load(file.arrayBuffer()); const form = pdfDoc.getForm(); const fields = form.getFields(); console.log("Fields", fields.length); fields?.forEach((field) => { console.log("Fields - name", field.getName();); }); </script>

Version

1.17.1

What environment are you running pdf-lib in?

Browser

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

@gMabdullah gMabdullah changed the title Fields not readabe wid Pdf-lib Fields not readable with Pdf-lib Nov 29, 2024
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

1 participant