Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Fri Aug 02, 2024 1:07 am

Hello,

I've been trying to adjust the spacing between lines of text in a document by inserting blank newlines and specifying a font size. I've tried the following code:

However, I've noticed that the arrow at the end of these blank lines isn't changing font size, preventing me from achieving the desired look.

Is there a method to modify the font size of the arrow at the end of these lines?

Code: Select all
Spire.Doc.Documents.Paragraph paragraph = sec.AddParagraph();
paragraph.AppendText("(ABCDE})");

//...?
paragraph.AppendText(@"

").CharacterFormat.FontSize = 5f;
paragraph.AppendText("1234");
///?
paragraph.AppendText($"{Environment.NewLine}   ").CharacterFormat.FontSize = 5f;

paragraph.AppendText("1234");
paragraph.AppendText($"{Environment.NewLine}   {Environment.NewLine}").CharacterFormat.FontSize = 5f;
paragraph.AppendText($"CCC");


Sungkyu_min
 
Posts: 36
Joined: Fri Jan 07, 2022 5:53 am

Mon Aug 05, 2024 7:16 am

Hi,

Thank you for inquiry.
The paragraph style will remain consistent when using your way, you can refer to the following code to set the difference for paragraphs. If you have any other questions, please feel free to write to me.
Code: Select all
 static void Main(string[] args)
         {
            Document document = new Document();
            Section sec = document.AddSection();
            Spire.Doc.Documents.Paragraph paragraph1 = sec.AddParagraph();
            paragraph1.AppendText("(ABCDE})");
            appendBlackPara(sec);
            Spire.Doc.Documents.Paragraph paragraph3 = sec.AddParagraph();
            paragraph3.AppendText("1234");
            appendBlackPara(sec);
            document.SaveToFile("Arrow.docx");
        }
        private static void appendBlackPara(Section sec)
        {
            Spire.Doc.Documents.Paragraph addParagraph = sec.AddParagraph();
            addParagraph.BreakCharacterFormat.FontSize=5f;   
        }

Sincerely,
Amin
E-iceblue support team
User avatar

Amin.Gan
 
Posts: 306
Joined: Mon Jul 15, 2024 5:40 am

Return to Spire.Doc