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.

Tue May 14, 2024 4:36 am

Hi Team ,


Please let me know ,how to set horizontal and vertical value for paragraph.


Thanks in advance

pr20080798
 
Posts: 159
Joined: Wed Jan 20, 2021 1:15 pm

Tue May 14, 2024 8:25 am

Hi,

Thank you for your message.
Sorry, I didn't quite understand what you meant. Word documents are streaming documents. In Microsoft Word, there is no concept of horizontal or vertical position for the 'Paragraph' element, and therefore no setting for it. If I have misunderstood your requirement, please provide sample files for us to investigate, thanks!

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 460
Joined: Mon Nov 07, 2022 8:10 am

Tue May 14, 2024 9:52 am

Thank you for reply .



Paragraph paragraph = section.addParagraph();
TextRange text = paragraph.appendText(description); //This "description" i have to write at specific location(specific horizontal and
vertical location)
CharacterFormat characterFormat = text.getCharacterFormat();
characterFormat.setFontName("Calibri");
characterFormat.setTextColor(Color.decode(color));
characterFormat.setFontSize(fontSize);
characterFormat.setBold(true);

pr20080798
 
Posts: 159
Joined: Wed Jan 20, 2021 1:15 pm

Wed May 15, 2024 7:56 am

Hi,

Thank you for the further explanation.
But as I replied earlier, Word is a streaming document and can't position the text. If you must position it, you can only use Textbox, please see the following tutorial for details:

Insert or Remove a Text Box in Word: https://www.e-iceblue.com/Tutorials/Spi ... B.NET.html

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 460
Joined: Mon Nov 07, 2022 8:10 am

Return to Spire.Doc