Hello,
Thanks for your inquiry and sorry for late reply as weekend.
Kindly note that our Spire.Doc based on the MS Word document, which is flow document and does not contain any information about its layout into lines and pages. So there is no way to get the last character of each line. But if each line in your document is independent paragraph, you can use the following code to count the characters and get the last character.
- Code: Select all
Paragraph para = section.Paragraphs[0];
int count = para.CharCount;
string lastChar = para.Text.Remove(0, para.Text.Length - 1);
Please refer to the following code to set the font as "Simplified Arabic".
- Code: Select all
foreach (Paragraph para in section.Body.Paragraphs)
{
foreach (DocumentObject obj in para.ChildObjects)
{
if (obj is TextRange)
{
TextRange range=obj as TextRange;
range.CharacterFormat.Bidi = true;
range.CharacterFormat.FontNameBidi = "Simplified Arabic";
}
}
}
If there is any question, please provide your input Word file as well as your expected output for our reference.
Sincerely,
Nina
E-iceblue support team