I have this form standard form of lease and i need to fill this with dynamic values using javascript. I tried using pdf-lib
to get all the fields but it gives me empty array with some warning Trying to parse invalid object:
in console.
const formUrl = 'https://forms.mgcs.gov.on.ca/dataset/edff7620-980b-455f-9666-643196d8312f/resource/929691d6-56bf-4d64-8474-0e434bb2d32d/download/2229e.pdf'
const formPdfBytes = await fetch(formUrl).then(res => res.arrayBuffer())
const pdfDoc = await PDFDocument.load(formPdfBytes,{
ignoreEncryption: true,
})
const form = pdfDoc.getForm()
const fields = form.getFields()
Any ways to achieve this?