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

pdfDoc.addJavaScript is not a function

Open viveksingh007 opened this issue 5 years ago • 2 comments

I am trying to add custom validation on textField using the addJavaScript function. While doing so getting an error 'pdfDoc.addJavaScript is not a function'. Adding the code snippet

`const pdfDoc = await PDFDocument.create()

    pdfDoc.addJavaScript(
        'foo',
        'function foo() { return "foo"; }'
    );`

Above javaScript function want to call on textFiled change event.

Please help me to achieve this.

viveksingh007 avatar Jan 25 '21 17:01 viveksingh007

Bump

timothyjohnwilson avatar Mar 15 '21 23:03 timothyjohnwilson

Please fill out the new bug report form if you're still having trouble with this.

Hopding avatar Sep 24 '21 00:09 Hopding