I am converting a word document to Html. I want to apply some CSS to the Html document while saving it. How can I do that?
Thank you.
I am converting a word document to Html. I want to apply some CSS to the Html document while saving it. How can I do that?
Thank you.
Thanks for your inquiry. Unfortunately, Aspose.Words does not provide API to apply CSS while saving Word document to HTML. In your case, we suggest you following solution.
Please read following article. Hope this helps you.
Using DocumentBuilder to Modify a Document Easily
Thank you for the suggestion, Tahir. I wasn’t however, able to set the width of the document. Is there a method/property I can use to set the document width?
Thank you.
Thanks for your inquiry. Please use PageSetup.PageWidth property to get or set the width of the page in points. Following code example show how to use this property.
If you still face problem, please share your input and expected output documents. We will then provide you more information on this.
Document doc = new Document(MyDir + "input.docx");
foreach (Section section in doc.Sections)
{
section.PageSetup.PageWidth = 600;
}
doc.Save(MyDir + "output.docx");