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 Oct 18, 2023 12:12 pm
Hi Team ,
Please let us know that is it possible to process html string in Spire API.
input :
<p>dataaaaaaaaaaaaaaaaaa</p>
<p> </p>
<p><b>as-is</b></p>
<p> </p>
<p>sssssssssssssssssssss</p>
Ouput should be:
dataaaaaaaaaaaaaaaaaa
as-is
sssssssssssssssssssss
-
pr20080798
-
- Posts: 159
- Joined: Wed Jan 20, 2021 1:15 pm
Thu Oct 19, 2023 3:13 am
Hi,
Thanks for your feedback.
our product does provide APIs for directly loading HTML files or adding HTML string to paragraphs.
Please refer to the following sample code snippet:
- Code: Select all
String html =
"<p>dataaaaaaaaaaaaaaaaaa</p>\n" +
"<p> </p>\n" +
"<p><b>as-is</b></p>\n" +
"<p> </p>\n" +
"<p>sssssssssssssssssssss</p>";
Document doc = new Document();
Section section = doc.addSection();
Paragraph paragraph = section.addParagraph();
paragraph.appendHTML(html);
- Code: Select all
Document doc1 = new Document();
doc1.loadFromFile("test.html", FileFormat.Html, XHTMLValidationType.None);
Best regards,
Triste
E-iceblue support team
-
Triste.Dai
-
- Posts: 1000
- Joined: Tue Nov 15, 2022 3:59 am