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

align horizontally text field in acrobat

Community Beginner ,
Oct 19, 2017 Oct 19, 2017

Copy link to clipboard

Copied

Hello everybody. Is there any way to align a line of a text field horizontally, and then, when you press enter, the two lines of text are both horizontally aligned as well? please check this image, to make it more clear.

Untitled-1.jpg    

Maybe some javascript code to solve it?

thanks!

TOPICS
Acrobat SDK and JavaScript , Windows

Views

1.8K

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

correct answers 1 Correct answer

Community Expert , Oct 19, 2017 Oct 19, 2017

If you allow rich text formatting, a user can select the text in the field and then use the properties toolbar to format the selection to vertically center but you can't force them to do so. If you enter a value (not a default value) and do the formatting for them, they can edit it and your formatting will "stick" however, the formatting will get reset if they clear the form.

In short, it can be done but can't be enforced.

Votes

Translate

Translate
Community Expert ,
Oct 19, 2017 Oct 19, 2017

Copy link to clipboard

Copied

No need for JavaScript. Just set the field Options to align center and multiline.

Screenshot 2017-10-19 12.48.56.png

If you were thinking of having them also center vertically in the field height... No. It can't be done... even with JavaScript.

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 Beginner ,
Oct 19, 2017 Oct 19, 2017

Copy link to clipboard

Copied

yes, i mean center the height field...

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 ,
Oct 19, 2017 Oct 19, 2017

Copy link to clipboard

Copied

If you allow rich text formatting, a user can select the text in the field and then use the properties toolbar to format the selection to vertically center but you can't force them to do so. If you enter a value (not a default value) and do the formatting for them, they can edit it and your formatting will "stick" however, the formatting will get reset if they clear the form.

In short, it can be done but can't be enforced.

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 Beginner ,
Jul 17, 2023 Jul 17, 2023

Copy link to clipboard

Copied

LATEST

This only works if you're not using a list box. If you use a list box there is no ability to centre the text in the properties panel. Hence the need for a JavaScript workaround.

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