Text Field Properties: Alignment (set from code) ?  SOLVED

PDF-XChange Editor SDK for Developers

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

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Text Field Properties: Alignment (set from code) ?

Post by zarkogajic »

Hi Support,

I'm adding an FFT_Text field using AcroForm.CreateField. I can set some props like multiline using TFF_MultiLine flag.

What flag to use or how to set "Alignment"?

image.png

-žarko
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Text Field Properties: Alignment (set from code) ?

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

When you have the IPXC_FormField interface, then you can obtain the Widget. After that cast it's Data to IPXC_AnnotData_Widget and you will have the DefaultTextAlign method - then you can set it for example with UIX_TextAlign.UIX_TextAlign_Center.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Text Field Properties: Alignment (set from code) ?

Post by zarkogajic »

Hi Alex,

UIX_TextAlign_Center cannot be used for that - it specifies non applicable values

The correct value for DefaultTextAlign center alignment is "1" - but it seems there's no enum defined for it?

-žarko
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Text Field Properties: Alignment (set from code) ?

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

Yup, sorry - the possible values are from PXC_TextJustification flags:
TJ_Left = 0
TJ_Center = 1
TJ_Right = 2

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: Text Field Properties: Alignment (set from code) ?  SOLVED

Post by zarkogajic »

Hi Alex,

That's it, thanks.

Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Text Field Properties: Alignment (set from code) ?

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply