Hi, From the given details, we have found that your requirement is to convert the Blazor page (Razor) to a Word document. Using Syncfusion Word (DocIO) library, you can convert the HTML to a Word document. To achieve your requirement, we suggest you get the Blazor page in HTML format. Then using the DocIO library, you can either convert the HTML file to a Word document or you can insert or add an HTML string into the Word document. Refer to our UG documentation link to know about how to convert an HTML file to a Word document, help.syncfusion.com/file-formats/docio/html Refer to our UG documentation link to know about how to insert or add HTML string into the Word document, help.syncfusion.com/file-formats/docio/html#customizing-the-html-to-word-conversion
Hi, Thank you for reaching out. To do normal and bold on one paragraph like “This is content”, we suggest you add the text to the paragraph and set the Bold property of the character format as true for particular text like “content”. Please use the below-highlighted code snippet, //Create a new Word document. using (WordDocument document = new WordDocument()) { //Add new section to the document. IWSection section = document.AddSection(); //Add new paragraph to the section. IWParagraph firstParagraph = section.AddParagraph(); //Add new text to the paragraph. IWTextRange firstText = firstParagraph.AppendText("This is "); IWTextRange secondText = firstParagraph.AppendText("content"); //Set bold to the text. secondText.CharacterFormat.Bold = true; //Save the Word document to MemoryStream MemoryStream stream = new MemoryStream(); document.Save(stream, FormatType.Docx); } Please refer to our UG documentation link to know more about how to format the text in the Word document, help.syncfusion.com/file-formats/docio/working-with-paragraph#working-with-text.
can you do something like this but transforming a blazor page into a word?
Hi,
From the given details, we have found that your requirement is to convert the Blazor page (Razor) to a Word document.
Using Syncfusion Word (DocIO) library, you can convert the HTML to a Word document.
To achieve your requirement, we suggest you get the Blazor page in HTML format. Then using the DocIO library, you can either convert the HTML file to a Word document or you can insert or add an HTML string into the Word document.
Refer to our UG documentation link to know about how to convert an HTML file to a Word document,
help.syncfusion.com/file-formats/docio/html
Refer to our UG documentation link to know about how to insert or add HTML string into the Word document,
help.syncfusion.com/file-formats/docio/html#customizing-the-html-to-word-conversion
Hello Sir, how to do normal and bold on one paragraph like this: This is *content*
Hi,
Thank you for reaching out.
To do normal and bold on one paragraph like “This is content”, we suggest you add the text to the paragraph and set the Bold property of the character format as true for particular text like “content”. Please use the below-highlighted code snippet,
//Create a new Word document.
using (WordDocument document = new WordDocument())
{
//Add new section to the document.
IWSection section = document.AddSection();
//Add new paragraph to the section.
IWParagraph firstParagraph = section.AddParagraph();
//Add new text to the paragraph.
IWTextRange firstText = firstParagraph.AppendText("This is ");
IWTextRange secondText = firstParagraph.AppendText("content");
//Set bold to the text.
secondText.CharacterFormat.Bold = true;
//Save the Word document to MemoryStream
MemoryStream stream = new MemoryStream();
document.Save(stream, FormatType.Docx);
}
Please refer to our UG documentation link to know more about how to format the text in the Word document,
help.syncfusion.com/file-formats/docio/working-with-paragraph#working-with-text.
@@SyncfusionInc Thank you very much, Sir