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
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:
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:
But by reading with above script;
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
Additional Notes
No response
The text was updated successfully, but these errors were encountered: