pdffillerjs / pdffiller

Take an existing PDF Form and data and PDF Filler will create a new PDF with all given fields populated.
MIT License
286 stars 113 forks source link

Not able mark to check box #36

Open saurabhbhandari2006 opened 8 years ago

saurabhbhandari2006 commented 8 years ago

I have marked field on pdf using Adobe Cycle. I have marked checkbox of gender with input name as male and female. at the time creation of object we assigned value to it. but after writing to file. field not gets as marked one. please reply asap

whitef0x0 commented 8 years ago

Can you give us more information (like an example pdf so we can replicate this?).

ChristianDavis commented 7 years ago

@whitef0x0 I've found that it depends on the PDF, but most checkboxes or radios I have found you need to set them to "Yes" or "On" in order to mark them checked

yug95 commented 6 years ago

how to make a cross ?

duranmla commented 5 years ago

Any news about this? I have generated the FDF template for my PDF file. Which has something like:

topmostSubform[0].Page1[0].CheckBox1[0]: ""

I try to set that field to Yes in order to check the checkbox within the PDF and it doesn't work. I have properly populated other fields.

The data I am using is created like:

const preffixPage1 = "topmostSubform[0].Page1[0]";
    // use the utility function `generateFDFTemplate` if needed to generate the FDF object and know the keys
    const data = {
      "topmostSubform[0].Page1[0].CheckBox1[0]": "Yes",
      [`${preffixPage1}.#area[1].SSN1[0]`]: "023",
      [`${preffixPage1}.#area[1].SSN2[0]`]: "45",
      [`${preffixPage1}.#area[1].SSN3[0]`]: "6789",
      [`${preffixPage1}.CityStateZipCode[0]`]: faker.address.zipCode(),
      [`${preffixPage1}.Address[0]`]: faker.address.streetAddress(),
      [`${preffixPage1}.Email[0]`]: faker.internet.email(),
      [`${preffixPage1}.Name[0]`]: faker.name.findName(),
      [`${preffixPage1}.Phone1[0]`]: faker.phone.phoneNumber(),
      [`${preffixPage1}.Phone2[0]`]: faker.phone.phoneNumber(),
    };

Screenshot of the PDF: image

@whitef0x0 any idea? Sorry to bother if this is a bug I am happy to fix it. I just wanted to double check this issue since it is pretty needed feature and I am not able to do it.

duranmla commented 5 years ago

From what I can see at https://github.com/pdffillerjs/pdffiller/blob/master/test/test_complete.pdf and https://github.com/pdffillerjs/pdffiller/blob/master/test/test.js#L30 it should work as expected not sure what I am doing wrong.

joncorrin commented 4 years ago

Having the same problem.

export_value

Im setting the export value to Yes on the PDF and am using this object to pass through the pdffiller method. Everything is filling but checkboxes. Code also works with other PDFs but for some reason not this one.@duranmla were you able to resolve this?

{
  'business.entityType.LLC': 'Yes',
  'business.businessType.Service': 'Yes',
  'business.entityStartDate': '09/01/2017',
  'business.isOtherEntity': 'No',
  'business.hasOtherSubsidiaries': 'No',
  'business.hasSafetyProgram': 'No',
  'business.buildingHasDangerousMaterial': 'No',
  'business.hasOtherInsuranceWithCompany': 'No',
  'business.hasCancelled': 'No',
  'business.hasHadMisconductClaims': 'No',
  'business.hasBeenConvicted': 'No',
  'business.hasSafetyViolations': 'No',
  'business.hadBankruptcy': 'No',
  'business.hadLien': 'No',
  'business.hasTrust': 'No',
  'business.hasForeignOperations': 'No',
  'business.hasOtherVentures': 'No'
}

// actual code:
await pdfFiller.fillForm(filePath, filledPdfFilePath, filledObj, async (pdfErr) => {
            if (pdfErr) return next(Boom.badRequest(pdfErr));
            const streamBuffer = await fs.readFileSync(filledPdfFilePath);
            await fs.unlinkSync(filePath);
            await fs.unlinkSync(filledPdfFilePath);
            res.send(Buffer.from(streamBuffer, 'binary'));
          });
dweep119 commented 4 years ago

Same issue facing. Any updates....??

miguel7020g commented 4 years ago

i used foxit reader to export to csv, previously fill the checkbox ones exported you can see the value you need to pass

image

image

asapkot2 commented 4 years ago

I have the same issue. Any way to resolve this?

miguelGamboa7020 commented 4 years ago

i had the same problem and it was the reference ofthe filed i was using try cheking by conveting the file to csv and see the references there.