• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Auto delete blank spaces in a pdf

New Here ,
Nov 12, 2024 Nov 12, 2024

Copy link to clipboard

Copied

Hello,

I have a pdf Form built in Adobe Acrobat. The form is made from fields, such as radio buttons and text fields. In the middle of a page is a question with 2 radio buttons - yes and no. If yes, text_box_1 appears, if no the text_box1 is hidden, but it remains a big blank space in the middle of the page. After the text box, there are multiple other fields, for example checkbutton_1, checkbutton_2, text_field. I want that all the fields below the blank space to be automate moved up, so after filling the form, the user won't have big blank spaces in the middle of the page. Is it possible to do this with a script in Adobe? Thank you for any help!

TOPICS
JavaScript , PDF , PDF forms

Views

103

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Nov 12, 2024 Nov 12, 2024

Copy link to clipboard

Copied

The script associated with the radio button that shows or hides the text field can also manipulate all the following fields, moving them up and down. But this is only easily done for field widgets (or other annotations) while static page content (e.g. static text, background images, ...) is not subject to such easy manipulation.

 

You can also work with optional content groups (layers) here, one showing the page with the text field, one without. The script can then switch between those OCGs.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 12, 2024 Nov 12, 2024

Copy link to clipboard

Copied

Is there also a script for generating fields based on choosing radio button option? 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 12, 2024 Nov 12, 2024

Copy link to clipboard

Copied

LATEST

Yes, you can change the rect property of the fields.  For example, this script will move a field up by 2 inches:

var rc=this.getField("Text").rect;

this.getField("Text").rect=[rc[0], rc[1] + 2*72, rc[2], rc[3] + 2*72];

One inch is 72 points, so moving up 3 inches would be 3*72, etc.  You can create an array of field names then loop through the array and move all the fields up by a set number of points.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines