I am looking for an explanation and example of how to use the line tag as part of the Formatted Text Area Formatting.
<Line ... - Line Tag
Attribute Values Description
Leading A decimal value. The leading of the line.
LeadingType auto | atLeast | exactly Specifies how leading is calculated.
Thanks,
Line tag demo
Re: Line tag demo
Support · Jan 11, 2013Hello,
You can use the Line tag and its attributes leading and leadingType to set it to the lines in the FormattedTextArea without any problem. Below is the sample code for it.
Document document = new Document();
Page page = new Page();
document.Pages.Add(page);
FormattedTextAreaStyle style = new FormattedTextAreaStyle(FontFamily.Helvetica, 12, true);
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>; <line leading='20' leadingType='exactly'> and 2 line properties: leading, and leading type.</line> Text can " +
"also be rotated.</p>";
FormattedTextArea formattedTextArea = new FormattedTextArea(formattedText, 0, 0, 256, 400, style);
page.Elements.Add(formattedTextArea);
document.Draw(@"C:\MyDocument.pdf");
Thanks,
ceTe Software Support Team.
Re: Line tag demo
Forum member · Jan 11, 2013Your example states text can also be rotated. How is that accomplished.
Thanks,
Re: Line tag demo
Support · Jan 11, 2013Hello,
The whole text in the FormattedTextArea can be rotated to desired angle using Angle property of the FormattedTextArea class. Please refer documentation on members of FormattedTextArea class here
. Also below is a line of code for it.
formattedTextArea.Angle = 45;
Thanks,
ceTe Software Support Team.
Re: Line tag demo
Forum member · Jan 11, 2013One last question then I think I am fully loaded for this project.
From my prototype testing I can see line leading with leadingType exactly and leadingType atleast but I do not see how the leadingType auto is doing anything. Guess I am missing something here but how should it be used and how should it work?
Re: Line tag demo
Support · Jan 16, 2013Hello,
If you do not specify a leading type for the line tag, the default leading type will be auto. With auto leading type the leading value of the specified font will be applied. In auto leading if a leading value is specified by the user it will be ignored. As setting auto leading type explicitly will not change the default leading, there will not be any change to the text.
Thanks,
ceTe Software Support Team.