Reputation: 1279
We are using the npm package pdffiller to fill in PDFs with our data. On 1 PDF, we have set the export value of checkboxes to 'Yes' and it checks the boxes fine. On another, we have done the same but it is not checking the boxes.
Im attaching the PDF. Note, we are only testing a few checkboxes to start. Please see the field named business.entityType.LLC under Applicant Information on page 1 (LLC options). We've tested this on a few but this is an easy example.
https://joncorrin.s3-us-west-2.amazonaws.com/Acord_125.pdf
Here's an example of the object we're passing into pdffiller with Yes as the data values (which should cause the check)
{
'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'
}
Here is the core of our pdffiller code after object creation
// 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'));
});
Upvotes: 3
Views: 663
Reputation: 1279
I believe my issue was that either the whole PDF or just the checkbox fields were locked. Oddly all fields were filling but the checkbox fields. When I ran the PDF through this software -> https://smallpdf.com/ to unlock the PDF, the checkboxes started checking.
Upvotes: 1