File tree Expand file tree Collapse file tree 1 file changed +1
-8
lines changed
HTML-conversions/Change-format-after-append-html/.NET/Change-format-after-append-html Expand file tree Collapse file tree 1 file changed +1
-8
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ static void Main(string[] args)
1919 int paraIndex = section . Body . Paragraphs . Count - 1 ;
2020
2121 // Append HTML content to the document with formatting in <p> tag.
22- document . LastParagraph . AppendHTML ( "<p style='color:blue; font-weight:bold;' >The Giant</p><p style='color:green; font-style:italic;' >Panda</p>" ) ;
22+ document . LastParagraph . AppendHTML ( "<p>The Giant</p><p>Panda</p>" ) ;
2323
2424 // Iterate through the paragraphs in the section's body.
2525 for ( int i = paraIndex ; i < section . Body . ChildEntities . Count ; i ++ )
@@ -31,13 +31,6 @@ static void Main(string[] args)
3131 // Set the paragraph formatting spacing to 0.
3232 paragraph . ParagraphFormat . BeforeSpacing = 0 ;
3333 paragraph . ParagraphFormat . AfterSpacing = 0 ;
34-
35- // Iterate through the items in the paragraph to chnage formatting.
36- foreach ( var item in paragraph . ChildEntities )
37- {
38- if ( item is WTextRange textRange )
39- textRange . CharacterFormat . TextColor = Syncfusion . Drawing . Color . DarkGreen ; // Change text color
40- }
4134 }
4235 }
4336 // Save the modified document.
You can’t perform that action at this time.
0 commit comments