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

Not finding fillable fields #1670

Open
2 tasks done
oliveryasuna opened this issue Aug 29, 2024 · 2 comments
Open
2 tasks done

Not finding fillable fields #1670

oliveryasuna opened this issue Aug 29, 2024 · 2 comments

Comments

@oliveryasuna
Copy link

oliveryasuna commented Aug 29, 2024

What were you trying to do?

My goal was to fill a PDF.

For the sake of this issue, I will reduce to scope to simply finding a field.

How did you attempt to do it?

BC-WasteForm.pdf

If you open this PDF in Adobe Acrobat, you can clearly see that the field, TransporterTrailer2Province, exists:
image

Furthermore, macOS Preview and a bunch of online PDF form fillers do identify this field.

If you run the following code, you should expect it to show in the table:

const document: PDFDocument = (await PDFDocument.load(fs.readFileSync('...')));
const form: PDFForm = document.getForm();

console.table(form.getFields()
    .map((field: PDFField) => ({
      name: field.getName(),
      type: field.constructor.name
    })));

What actually happened?

For some reason, TransporterTrailer2Province, is not listed in the table.

We can simplify the code to produce the issue:

const document: PDFDocument = (await PDFDocument.load(fs.readFileSync('...')));
const form: PDFForm = document.getForm();

form.getField('TransporterTrailer2Province');
Error: PDFDocument has no form field with the name "TransporterTrailer2Province"

What did you expect to happen?

I expected pdf-lib to find the field.

How can we reproduce the issue?

Please see above...

Note that I have tested this when ran in Node (through Vitest) and in the browser.

Version

1.17.1

What environment are you running pdf-lib in?

Browser, 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

Thank you very much for your time!

@dev01prishusoft
Copy link

Hello, I have same issue is there any update on this ?

@Monkeytactics
Copy link

I have this issue too. In my case 95 of 250 form fields are not identifiable by PDFLIB, yet found using other tools.

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