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.
Wed Mar 30, 2022 6:25 am
Hi Team ,
Please let me know is it possible convert string variable INPUT(in below mentioned code) into Paragraph object ?
//code
Paragraph paragraph = (Paragraph) object;
String INPUT = paragraph.getText(); //
Thanks in advance
-
pr20080798
-
- Posts: 146
- Joined: Wed Jan 20, 2021 1:15 pm
Wed Mar 30, 2022 8:50 am
Hello,
Thank you for your inquiry.
Are you trying to convert the string to the paragraph object using our Spire.Doc? If yes, please refer to the code below:
- Code: Select all
Paragraph paragraph = (Paragraph) object;
String INPUT = paragraph.getText();
Document newDocument = new Document();
Section section1 = newDocument.addSection();
//This paragraph is a string converted to a paragraph object
Paragraph paragraph1 = section1.addParagraph();
paragraph1.setText(INPUT);
Sincerely,
Annika
E-iceblue support team
-
Annika.Zhou
-
- Posts: 1643
- Joined: Wed Apr 07, 2021 2:50 am
Mon Apr 11, 2022 8:40 am
Hello,
Hope you are doing well!
How is your issue going? Did the code we provided work for you? Any feedback will be greatly appreciated.
Sincerely,
Annika
E-iceblue support team
-
Annika.Zhou
-
- Posts: 1643
- Joined: Wed Apr 07, 2021 2:50 am