Dropdown Fields - Wrap Text

This Forum is for the use of End Users requiring help and assistance for Tracker Software's PDF-Tools.

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Stefan - PDF-XChange

emmamp
User
Posts: 15
Joined: Sun Jun 23, 2024 11:49 pm

Dropdown Fields - Wrap Text

Post by emmamp »

Hi everyone!

Is there any way to make a dropdown field multi-line (i.e wrap the text). I see this is possible on a text box but the option is not available for a dropdown box. Are there any work arounds?

Screenshot of options available in Properties:
Capture.PNG
Thanks :)
You do not have the required permissions to view the files attached to this post.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: Dropdown Fields - Wrap Text

Post by Stefan - PDF-XChange »

Hello emmamp,

You can force that with some JS.
E.g. if your field is called Dropdown1 you can use this

Code: Select all

this.getField("Dropdown1").setItems(["Red\nApple", "orange", "Red\nPear"]);
To get your field display these options:
image(2).png

I could only do it with JS, as the Combo Box Items part of the properties pane would not allow you to enter multi line entries and would display only the first lines for the above example:
image(1).png
Kind regards,
Stefan
You do not have the required permissions to view the files attached to this post.
emmamp
User
Posts: 15
Joined: Sun Jun 23, 2024 11:49 pm

Re: Dropdown Fields - Wrap Text

Post by emmamp »

Excellent, that works perfectly! Thank you :)

I have one more question if you are able to assist @Tracker Supp-Stefan. Is there a way to vertically centre text in a text box - without reszing the box to vertically centre it?
You do not have the required permissions to view the files attached to this post.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: Dropdown Fields - Wrap Text

Post by Stefan - PDF-XChange »

Hello emmamp,

Are those text box annotations or form fields?
I believe that in both the only way to do it would be to use lines placed above the text you want to center, sorry.

Kind regards,
Stefan
emmamp
User
Posts: 15
Joined: Sun Jun 23, 2024 11:49 pm

Re: Dropdown Fields - Wrap Text

Post by emmamp »

They are form fields.

No problem, thank you! :)
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11292
Joined: Wed Jan 03, 2018 6:52 pm

Re: Dropdown Fields - Wrap Text

Post by Daniel - PDF-XChange »

Hello, emmamp

Unfortunately than, Stefan is correct. The only way to center text vertically in a form field is to disable text wrapping. If wrapping is enabled, the text will be top aligned at all times.

Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com