Hi guys
We encountered a new problem by using Aspose.word which version is 22.11 at dot-net platform.
When I inserted html with the following code, the generated Word document could not use the background color button of the paragraph to clear its background color.
Later, we found that its background color effect was set by the styles in Word.
Document doc = new Document("d:\\1.docx", new Aspose.Words.Loading.LoadOptions() { LoadFormat = LoadFormat.Auto });
DocumentBuilder db = new DocumentBuilder(doc);
db.MoveToDocumentEnd();
db.InsertHtml("<p style=\"margin-top:6pt; margin-left:1.35pt; margin-bottom:6pt; font-size:10pt\"><span><span style=\"font-family:Arial; background-color:#ffff00\">(</span></span><span id=\"c3e7e385_af87_4366_bb2d_1a8fcae11054\" sys=\"1\"><pre style=\"font-family:Arial; background-color:#ffff00\">Selected specimen(s) was/were tested as specified by the applicant, please refer to test result page(s) for details) </pre></span><span id=\"b1362029_99fa_4401_9881_0c78cd522d5a\" sys=\"1\"><span style=\"font-family:Arial; background-color:#c0c0c0\">(Selected specimens</span><span style=\"font-family:宋体; background-color:#c0c0c0\">客户指定</span></span><span><span style=\"font-family:宋体; background-color:#c0c0c0\">测试</span></span><span id=\"a2baf6cd_6f8a_4c65_bc4a_ff03043e3c10\" sys=\"1\"><span style=\"font-family:宋体; background-color:#c0c0c0\">物料</span><span style=\"font-family:Arial; background-color:#c0c0c0\">)</span></span></p>", true);
doc.Save("d:\\style.docx", SaveFormat.Docx);
Is there any way? The background-color CSS Style in the html I inserted applies the background color in the paragraph instead of using the heavyweight setting of style.
bellow is the document generated base on upon code .
style.docx (21.0 KB)