We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Can't load css file to exporting?

hi,


i am using the code as below:

var doc = new Document();
var builder = new DocumentBuilder(doc);
builder.InsertHtml(html);
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.
http://www.aspose.com/docs/display/wordsnet/Aspose.Words.LoadOptions.BaseUri+Property

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:
http://www.aspose.com/docs/display/wordsnet/How+to++Insert+a+Document+into+another+Document

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