Skip to main content
Known Participant
June 27, 2019
Answered

Multiline Button Label

  • June 27, 2019
  • 3 replies
  • 2746 views

I'm in Acrobat Pro I have a 50 plus page document. What I want to do is create buttons that will print certain forms within the document. My question is not with creating the button, but with the label of the button - can you have a multiline button label. I'd like the label to be, Finalization Documents JV-364 and VS-44, just like the image below. Would this be possible?

          

Finalization Documents

JV-364 and VS-44

This topic has been closed for replies.
Correct answer try67

You can do it using this code:

this.getField("Button1").buttonSetCaption("Finalization Documents\nJV-364 and VS-44");

3 replies

Participant
November 25, 2019

Here's another way you can do it, and have absolute control of mixing fonts, colors, pictures, etc:

You are probably adding the button onto the forms overlay that has a printed page behind it.

1. Revise that printed page in Word, etc., by placing onto it a box containing the legend exactly as you want it to look. 

2. Make a separate PDF of only that page.

3. While editing the original PDF, use the Replace Pages function to substitute the new printed page from that separate PDF for the old printed page.

4. Add a button to your form. Set its appearance properties to have its Fill Color as "no color" and the options properties to have the label text blank. You probably want to have your Border Color as "no color" too so you have some size flexibility in the next step.

5. Position and stretch that new, transparent, button over the multi-line legend you created on the new printed page.

6. Set your Actions to whatever you want your button to do.

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
June 28, 2019

You can do it using this code:

this.getField("Button1").buttonSetCaption("Finalization Documents\nJV-364 and VS-44");

Angus24Author
Known Participant
June 28, 2019

Thank you for the coding try67. I copied and pasted it under the Actions tab of the button Properties, Under the Select Trigger I have Mouse Up and the Select Action is Run a JavaScript.

Unfortunately nothing is showing on the button. Did I place the coding in the correct area and select action?

Bernd Alheit
Community Expert
Community Expert
June 28, 2019

You must execute the code in the console.

Bernd Alheit
Community Expert
Community Expert
June 28, 2019

Create an image with the text and use the image as icon of the form button.