Dropdown Fields - Wrap Text

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

Moderators: Tracker Support, TrackerSupp-Daniel, Sean - Tracker, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Tracker Supp-Stefan

Post Reply
emmamp
User
Posts: 6
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
Capture.PNG (5.55 KiB) Viewed 400 times
Thanks :)
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 18407
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Dropdown Fields - Wrap Text

Post by Tracker Supp-Stefan »

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
image(2).png (8.88 KiB) Viewed 380 times

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
emmamp
User
Posts: 6
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?
Attachments
centre.PNG
centre.PNG (5.46 KiB) Viewed 344 times
centre.PNG
centre.PNG (4.83 KiB) Viewed 344 times
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 18407
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Dropdown Fields - Wrap Text

Post by Tracker Supp-Stefan »

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: 6
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
TrackerSupp-Daniel
Site Admin
Posts: 9111
Joined: Wed Jan 03, 2018 6:52 pm

Re: Dropdown Fields - Wrap Text

Post by TrackerSupp-Daniel »

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
Tracker Software Products (Canada) LTD

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