These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Addition of dynamic rows in Acro-form and pushing down the fields below it to accomodate new rows

PDFchild
Registered: Oct 31 2010
Posts: 44

I am developing an Acro-form for myself and I have average knowledge of JS
 
I some how managed to code a button which adds new rows to a table. But I need to be able to move the table below it (again a set of fields), down to accommodate new rows.
 
This was easy in LC but I have to make an iPAD version which doesn't allow XFA.
 
Please help
 

Thank you.

PDFchild [at] gmail [dot] com - Go Green Save Paper Adopt a PDF

My Product Information:
Acrobat, Windows
PDFchild
Registered: Oct 31 2010
Posts: 44
PDFchild wrote:
I am developing an Acro-form for myself and I have average knowledge of JSI some how managed to code a button which adds new rows to a table. But I need to be able to move the table below it (again a set of fields), down to accommodate new rows.

This was easy in LC but I have to make an iPAD version which doesn't allow XFA.

Please help


Thank you.
So this action has to be linked with the ADD and REMOVE buttons I coded

thanks again

PDFchild [at] gmail [dot] com - Go Green Save Paper Adopt a PDF

try67
Expert
Registered: Oct 30 2008
Posts: 2398
It can't be done automatically. You need to create a function that changes the rect property (specifically, the y-axis location) of each field.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

PDFchild
Registered: Oct 31 2010
Posts: 44
Hello try67,

Many thanks for the reply. I have never used rect before. Can you post a simple sample script. I will try to modify it to my needs.

Does this apply to X axis, please don't mind my newbie questions :)


PDFchild [at] gmail [dot] com - Go Green Save Paper Adopt a PDF

try67
Expert
Registered: Oct 30 2008
Posts: 2398
Here's the code to move a field called "Text1" 20 points down a page:
  1. var f = getField("Text1");
  2. var r = f.rect;
  3. r[1] -= 20;
  4. r[3] -= 20;
  5. f.rect = r;
If you change the X-axis values of the rect (values 0 and 2), the field will move to the left or the right.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com