pdf-lib icon indicating copy to clipboard operation
pdf-lib copied to clipboard

Not finding fillable fields

Open oliveryasuna opened this issue 1 year ago • 4 comments

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

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

Additional Notes

Thank you very much for your time!

oliveryasuna avatar Aug 29 '24 01:08 oliveryasuna

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

dev01prishusoft avatar Sep 26 '24 09:09 dev01prishusoft

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

Monkeytactics avatar Nov 01 '24 14:11 Monkeytactics

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

Hello! Can you suggest me another tool for the form filling?)

pinetree avatar Nov 15 '24 08:11 pinetree

ms004-2403en-f-no-pw.pdf same with this form.

its only showing the following:

"Save button",
"1.Parts",
"1.Enrolling_Docs",
"1.Re-enrolling_Docs",
"1.Contact_Salut",
"1.Contact_OtherNames",
"1.Contact_Gender",
"1.Contact_Interpreter",
"1.ATSIAorigin",
"1.ATSIAorigin_Aboriginal",
"1.ATSIAorigin_Torres",
"1.ASSIorigin",
"1.Contact_OS",
"1.Contact_ResideAust",
"1.Contact_LHC",
"1.Contact_Declaration",
"1.Contact_Others",
"1.Add1_Previously",
"1.Add1_Salut",
"1.Add1_OtherNames",
"1.Add1_Gender",
"1.Add1_Interpreter",
"1.Add1_ATSIAorigin",
"1.Add1_ATSIAorigin_Aboriginal",
"1.Add1_ATSIAorigin_Torres",
"1.Add1_ASSIorigin",
"1.Add1_OS",
"1.Add1_ResideAust",
"1.Add1_LHC",
"1.Add1_Bank",
"1.Add1_BankDeclaration",
"1.Add1_Dec",
"1.Add2_Previously",
"1.Add2_Salut",
"1.Add2_OtherNames",
"1.Add2_Gender",
"1.Add2_Interpreter",
"1.Add2_ATSIAorigin",
"1.Add2_ATSIAorigin_Aboriginal",
"1.Add2_ATSIAorigin_Torres",
"1.Add2_ASSIorigin",
"1.Add2_OS",
"1.Add2_ResideAust",
"1.Add2_LHC",
"1.Add2_Bank",
"1.Add2_BankDeclaration",
"1.Add2_Dec",
"1.Add3_Previously",
"1.Add3_Salut",
"1.Add3_OtherNames",
"1.Add3_Gender",
"1.Add3_Interpreter",
"1.Add3_ATSIAorigin",
"1.Add3_ATSIAorigin_Aboriginal",
"1.Add3_ATSIAorigin_Torres",
"1.Add3_ASSIorigin",
"1.Add3_OS",
"1.Add3_ResideAust",
"1.Add3_LHC",
"1.Add3_Bank",
"1.Add3_BankDeclaration",
"1.Add3_Dec",
"1.Add4_Previously",
"1.Add4_Salut",
"1.Add4_OtherNames",
"1.Add4_Gender",
"1.Add4_Interpreter",
"1.Add4_ATSIAorigin",
"1.Add4_ATSIAorigin_Aboriginal",
"1.Add4_ATSIAorigin_Torres",
"1.Add4_ASSIorigin",
"1.Add4_OS",
"1.Add4_ResideAust",
"1.Add4_LHC",
"1.Add4_Bank",
"1.Add4_BankDeclaration",
"1.Add4_Dec",
"1.DupCard",
"1.NewB_Salut",
"1.NewB_OtherNames",
"1.NewB_Relation",
"1.NewB_Interpreter",
"1.NewB_Partner",
"1.NewB_PartYourCard",
"1.NewB_DupCard",
"1.Part_AddChild",
"1.Part_Salut",
"1.Part_OtherNames",
"1.Part_Relation",
"1.Part_AddedMSN",
"1.NewB_AddedMSN",
"1.Child_Gender",
"1.Child_ATSIAorigin",
"1.Child_ATSIAorigin_Aboriginal",
"1.Child_ATSIAorigin_Torres",
"1.Child_ASSIorigin",
"1.Child_MyHealth",
"1.NewB_Declaration",
"1.Part_Declaration",
"1.MHR_Enrol",
"1.MHR_Want",
"1.MHR_AddPeople",
"1.MHR_Add1_CurrentlyHave",
"1.MHR_Add1_Declaration",
"1.MHR_Add1_MorePeople",
"1.MHR_Add2_CurrentlyHave",
"1.MHR_Add2_Declaration",
"1.MHR_Add2_MorePeople",
"1.MHR_Add3_CurrentlyHave",
"1.MHR_Add3_Declaration",
"1.MHR_Add3_MorePeople",
"1.MHR_Add4_CurrentlyHave",
"1.MHR_Add4_Declaration",
"1.MHR_Declaration"

but a lot of other fields were missing, like 1.Contact_FamName

buonzz avatar Nov 25 '24 06:11 buonzz