Open farling42 opened 6 months ago
pdfjs library has ButtonWidgetAnnotation in src/core/annotation.js
button.data.checkBox (not RADIO and not PUSHBUTTON) button.data.radioButton (RADIO and not PUSHBUTTON) button.data.pushButton (PUSHBUTTON)
Then uses one of _processCheckBox, _processRadioButton, _processPushButton
pdfjs creates elements of type "button".
It looks like setValue
will always be called (even if the value hasn't changed, because pdf-pager doesn't know if the application value has changed).
But the event handler hooks might only register on blur
or updatefromsandbox
events.
I can't find a free PDF editor which will let me edit buttons (not checkable or radio buttons), so that I can set just the "alternativeText" which is required if there isn't an "A" or "AA" link associated with the button.
The simplest option at the moment is to create a checkbox and set the setValue
function to trigger the corresponding Foundry JS code.
Version 0.49.1 has some basic support for clicking on a button. I haven't been able to get hold of a form-fillable PDF which has buttons configured it which will get displayed by the pdfjs library (the button needs to have an A or AA link in it).
Update the field mapping object so that PDF buttons can be triggered and will call an appropriate function on the field object.