'Execute JavaScript using IText

I have a dynamic pdf file which needs to be filled programmatically. I am using itext libraries to do so. Below are the steps I followed.

  1. Extract the dynamic pdf and get the data xml file.
  2. Fill the xml data file.
  3. Call the itext apis to generate new pdf by passing the template pdf and xml data file.

The issue I face is if there is a repeater inside the container (which has a close button) in the template pdf, its not copied into the generated interactive pdf file. None of the javascript functionalities are triggered when creating the new pdf and because of which some of the fields become read only.

Is it possible to trigger the javascript in the pdf while generating the new pdf or while opening the new pdf?

Much appreciate any help.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source