List of PDF Form fields actions

Hi,

Can aspose.PDF extract a list of all actions associated to PDF Form fields?

If yes, what class can be used to get this list?

Can aspose.PDF EXECUTE an action already set on a form field?

Thank you

Catalin

@CatalinBombea

Thank you for contacting support.

Would you please share sample PDF document along with screenshot of how these actions can be accessed with Adobe Acrobat so that we may investigate and assist accordingly.

In Acrobat, a new action can be added from Tools-Action Wizard-Create New Action. (an Execute JavaScript action can be added)
Or: (in newer acrobat versions)

  • Using the Hand tool, right-click the bookmark, and choose Properties .
  • Using the Tools > Rich Media > Select Object tool, double-click the link, media clip, or
    form field, and choose Properties .
  • Click the Actions tab.
  • From the Select Action menu, select the action type to occur, and then click Add . You can add multiple actions; actions execute in the order that they appear in the Actions list box.
    In LiveCycle Designer, an action can be added if you right click a field-Add Action (at a specific event: click, change, exit and so on).
    As an example, dropdownliste1 has a script action at the change event, that shows/hides specific fields)
    Here is a file with screenshots: https://1drv.ms/b/s!AjfS33R8yoG9kepWFBEbqCWJ8FXrUA?e=sgwH2i

Test.pdf (2.5 MB)

I have to do the following:

  1. import pdf form data via import xml with data.
  2. hide/display specific fields. Manually, the change event associated with dropdownliste1 change event will trigger the script.
    after data is imported/populated in the form, the field dropdownliste1 will have a specific value, but the change event associated with this field will not be fired during import, so specific fields will no longer be automatically hidden/displayed.
    Example 2: if you look at page 2 Variante3 dropdownliste2, a different image will be loaded based on dropdown selection. After I programatically send a value to this dropdownliste2, the dropdown change event will not be fired automatically and the image displayed will be wrong.

Can aspose get a list of actions/scripts and fire them programmatically?
Like: RunScript (dropdownliste1.change)

Please note that I cannot use codes that refers to specific fields and scripts in a pdf form, because every time there will be a different pdf, with unknown scripts/actions/events, so I have to detect them and run them.

Thank you

@CatalinBombea

Thank you for elaborating it further.

We are afraid field actions may not be extracted or executed for such PDF documents. However, a ticket with ID PDFNET-47298 has been logged in our issue management system for further investigations and resolution. We will let you know once these features will be supported.