Formated Text Area - Align Text

Formated Text Area - Align Text

Forum member · Aug 26, 2009
How do you justify text in a formated text area?

Re: Formated Text Area - Align Text

Support · Aug 26, 2009
Hello, You can set the alignment to the text using the FormattedTextAreaStyle object. You will have to use the TextAlign enumeration for setting this alignment. Below is a line of code for this. formattedArea.Style.Paragraph.Align = TextAlign.Justify; Thanks, ceTe Software Support Team.

Re: Formated Text Area - Align Text

Forum member · Aug 26, 2009
I have over 50 formated text areas in my document, if add formatedtextfield.Style.Paragraph.Align = TextAlign.Justify, all of them get justified. Is there away around that?

Re: Formated Text Area - Align Text

Forum member · Aug 26, 2009
I only want specific fields to be justified.

Re: Formated Text Area - Align Text

Support · Aug 26, 2009
Hello, Setting this property to one FormattedTextArea will not affect the other formatted text areas. You have to set this to the specific formatted text area object for which you want to set the alignment. FormattedTextArea area = new FormattedTextArea(text, 100, 100, 100, 100, FontFamily.Helvetica, 20, true); //below line is for the "area" object alone. area.Style.Paragraph.Align = TextAlign.Justify; You can also create the FormattedTextAreaStyle object for each formatted text area separately. You will have to use this style object in the constructor of the FormattedTextArea. Below is the code. FormattedTextAreaStyle style = new FormattedTextAreaStyle(FontFamily.Courier, 12, true); style.Paragraph.Align = TextAlign.Justify; FormattedTextArea area = new FormattedTextArea(text, 100, 100, 100, 100, style); Thanks, ceTe Software Support Team.

Re: Formated Text Area - Align Text

Forum member · Apr 1, 2022
I am doing exactly this, however, if I later update the STYLE it changes all of my formattedtext areas. For instance, if I have some formatted text that is added to cell1 and the STYLE is set to left align at that time, then I later update the align to RIGHT on the style and add text to cell 2 all cells align RIGHT.

Re: Formated Text Area - Align Text

Support · Apr 4, 2022
Hi, If you are adding multiple FormattedTextAreas and looking for different styles, then please try using and a new Style object for each FormattedTextArea and see it works for you. If you continue facing an issue, then please send over following information to [^a|mailto:support@dynamicpdf.com|opennewwindow|support@dynamicpdf.com^] so we can look into it further. 1. Simple code or an application which uses static data to recreate the behavior. 2. Output PDF. 3. Exact version and build number of DynamicPDF DLL file used in your application. You can find this information by right clicking on the DLL file>>Properties>>Details tab>>Product version. Take a screenshot of Details tab and send it over to us. Thanks, ceTe Software Support Team