Hello,
We are trying to import some XHTML from a HTML editor control (which includes things like TABLEs and DIVs) into a Word document using DocIO.
The TABLEs and DIVs have some class tags assigned that releate to a CSS stylesheet.
We can't find a way to link a CSS stylesheet and putting the StyleSheet code into the XHTML doesn't seem to do anything.
Inline styles do work (see screenshot)... any ideas?
IWParagraph paragraph = section.AddParagraph();
string htmlstring = Resources.Files.source;
section.Body.InsertXHTML(htmlstring);
Resources.Files.source
<html>
<head>
<style type="text/css">
.WarningBox {
border: solid 1px #AA0000;
background-color: #FFDDDD;
padding: 20px;
}
</style>
</head>
<body>
<div class="WarningBox">
Box with CSS style
</div>
<div style="border: solid 1px #AA0000; background-color: #FFDDDD; padding: 20px;">
Box with inline styles
</div>
</body>
</html>
Attachment:
Styles_2dc81062.zip