Text.Align on FormattedTextArea seems not working

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v11)  /  Re: Text.Align on FormattedTextArea seems not working

DynamicPDF CoreSuite for .NET (v11) Forum

Hi,

I am trying to right align text using a FormattedTextArea by setting the Paragraph.Style.Align property to TextAlign.Right. However the text is aligned left.  How am I supposed to use this?
Posted by a ceTe Software moderator
Hi,

We tested this using v11 DynamicPDF Core Suite for .NET product and are unable to recreate the behavior.

Here is a code sample used for testing.

            Document document = new Document();
            Page page = new Page();
            document.Pages.Add(page);
            FormattedTextAreaStyle style = new FormattedTextAreaStyle(FontFamily.Helvetica, 12, false);
            // Create the text and the formatted text area
            string formattedText = "<p>Formatted text area provide rich formatting support for text that " +
               "appears in the document. You have complete control over 8 paragraph properties: " +
               "spacing before, spacing after, first line indentation, left indentation, right " +
               "indentation, alignment, allowing orphan lines, and white space preservation; 6 " +
               "font properties: <font face='Times'>font face, </font><font " +
               "pointSize='6'>font size, </font><font color='FF0000'>color, " +
               "</font><b>bold, </b><i>italic and </i><u>" +
               "underline</u>; and 2 line properties: leading, and leading type. Text can " +
               "also be rotated.</p>";

            FormattedTextArea formattedTextArea = new FormattedTextArea(formattedText, 0, 0, 256, 400, style);
            formattedTextArea.Style.Paragraph.Align = TextAlign.Right;
            page.Elements.Add(formattedTextArea);

            // Save the PDF
            string outputPath = @"C:\Temp\MyFTA.pdf";
            document.Draw(outputPath);

If you continue having an issue, then please send over following information to support@dynamicpdf.com  so we can look into it further.

1. Code sample which uses static data to recreate the behavior.
2. Output PDF.
3. Exact version and build number of the DynamicPDF Core Suite for .NET product DLL file used in your application. You can find this information by right clicking on the DynamicPDF Core Suite DLL file>>Properties>>Details tab>>Product version. Take a screenshot of Details tab and send it over to us.

Thanks,
ceTe Software Support Team

All times are US Eastern Standard time. The time now is 8:50 AM.