Can't load css file to exporting?


i am using the code as below:

var doc = new Document();
var builder = new DocumentBuilder(doc);
doc.Save(exportDirectory + "/doc/" + this.newFileName + ".doc", Aspose.Words.SaveFormat.Doc);

the html contain a , some elements as
. Ok, you can see the css only apply to style=“” attribute into the exported file but it didn’t apply to element into the file. I readed some post which use to loadOptionFormat, i think the loadOptionFormat is not difference to InsertHtml.

In this case, how to apply to css style from a file for exported file.

Thanks for your sharing.

Hi there,

Thanks for your inquiry. In your case, I suggest you please load the html in separate document as shared in following documentation link.

Once you have loaded the html into Aspose.Words.Document, please insert this document into your main document. Please read about inserting one document into another at any location from here:

Hope this helps you. Please let us know if you have any more queries.