Skip to main content
Known Participant
December 17, 2023
Question

Run Java script in Adobe InDesign

  • December 17, 2023
  • 3 replies
  • 923 views

Hi,

I converted all the forms from Word to PDF and customized them based on the requirement to have a digital signature (Using Acrobat Pro DC).

 

Some of these tables need to add/delete rows button. The IT department suggested the Indesign and provided me with the subscription. 

 

Unfortunately, I can not find a solution for running any Java Script to add a row to a table created in InDesign. (No name for the table that I can consider as an object).

 

please help me with the JS code, how can I run it in Indesign without knowing the table name?

 

Where I can run JS in Adobe Indesin tool?

 

Thanks in advance,

 

 

This topic has been closed for replies.

3 replies

JR Boulay
Community Expert
Community Expert
January 1, 2024

This can be done with Acrobat Pro, but the form fields do not have the concept of a table, you have to manage fields placed in a grid individually.

Acrobate du PDF, InDesigner et Photoshopographe
JR Boulay
Community Expert
Community Expert
December 19, 2023

You cannot edit a PDF form with InDesign.

You can redesign a new layout with InDesign and export to PDF.

Then with Acrobat Pro you can import the new PDF layout into your form (Page panel : Replace page), the fields will remain in place.

Acrobate du PDF, InDesigner et Photoshopographe
Neda GAuthor
Known Participant
December 20, 2023

Thank you. Is it possible to have a dynamic form in InDesign? I mean create a button to add/delete the row of a table? and also move the extra rows to another page and change the page number?  Most of the examples that I watched on YouTube are for designing the ebooks, and book coverage pages.

Thom Parker
Community Expert
Community Expert
January 1, 2024

A regular PDF form has a static layout, just like if it was paper. There is a lot that can be done with JavaScript to dynamically add fields, move them around, and delete fields. But this can get to be a monumental managment task. And it will only work when the form is viewed in Acrobat, or another really good compliant viewer. 

A simpler solution is to use Page Templates to add a sheet of fields for expanding the table, again, much like paper documents. 

And since you are talking about tables, an important consideration is naming. Field names directly affect the scripting. A good naming scheme can significantly simplify scripting. 

Take a look at this article, especially the bit about field names:

https://www.pdfscripting.com/public/PDF-Form-Scripting.cfm

 

   

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Bernd Alheit
Community Expert
Community Expert
December 18, 2023

Try the forum for InDesign.