Skip to main content
Participant
December 16, 2019
Question

If/then Command to delete and change positions of text boxes if null

  • December 16, 2019
  • 2 replies
  • 338 views

Hello!

 

I am trying to make a business card form for employees to fill out.  For the phone number portion there are a lot of options. Some employees have an office phone, office phone with an exstension, mobile number, and/or a fax line. 

 

My goal is to have it so that if a text box for a fax or mobile is left blank the text box(es) is deleted. Additionally, if an emlpoyee only has a mobile or a fax (I know it is almost 2020; who still uses fax?!) that the office phone box is deleted and all other textboxes' position is shifted up to keep with the formatting of the document. 

 

Any help would be greatly appreciated! 🙂

This topic has been closed for replies.

2 replies

Thom Parker
Community Expert
Community Expert
December 16, 2019

Here's an article that explains page coordinates and positioning fields:

https://www.pdfscripting.com/public/PDF-Page-Coordinates.cfm?sd=40

 

You'll find two sample PDFs here that demonstrate creating new fields and moving them about on the page.

They're called "Bouncing Button" and "Swat the Fly":

https://www.pdfscripting.com/public/Free-Sample-PDF-Files-with-scripts.cfm

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Legend
December 16, 2019

While it's not completely impossible to move text boxes around, it's pretty tiresome. I suggest instead you just think in terms of the card being a series of lines, and fill them as you need to. Really, though, such a flexible layout is better done in Word.

Participant
December 16, 2019

Thanks for the feedback, but this needs to be completed as a form in Adobe Acrobat