Add 2nd line to the 1st paragraph, create 2nd paragraph. Add a line break into the 1st paragraph.ĭb.InsertSpecialCharacter(SpecialCharacterType.LineBreak) Add 1st paragraph with formatted text.ĭb.CharacterFormat.FontColor = Color.Orange ĭb.Write("This is a first line in 1st paragraph!") String docPath = Create a new document and DocumentBuilder.ĭocumentBuilder db = new DocumentBuilder(dc) public static void CreateHtmlUsingDocumentBuilder() Way 1: Creating a new document using DocumentBuilderĭocumentBuilder is a powerful class that is associated with a DocumentCore and allows dynamic document building from scratch or the addition of new elements to an existing document.Įverything that is possible with DocumentBuilder is also possible when using the classes of the DOM (Document Object Model) directly, but usually require more lines of code than using DocumentBuilder. Using DOM (Document Object Model) directly. Use any of them, which is more clear to you: Here we'll you show two ways to create the same HTML document from a scratch.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |