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

Free Support Forum - aspose.com

CSS in <style> tag within <head>

I am trying to convert an XHTML document to .doc . I got the general understanding from reading through your forums that you still do not support external CSS stylesheets. However, in this case the style are sitting within the head tag. The beginning of the file looks like the one shown below. I would understand if you don’t support all the rules, particularly the CSS3 rules, but do you support ANY CSS? When I try and save the document, none of the style rules seem to be applied.
========================================

/* BSC Document Template CSS Rules /
/
These general rules describe the margins, headers, footers, font-sizes, and other attributes which all BSC documents should adhere to. If needed, they may be overridden in the individual document’s CSS file. */

@page {
size: ansi-a;
margin: 1in 1in 1in 1.5in;
@top-center { content: flow(header); font-weight: bold; font-family: “Times New Roman”, Times, serif; font-size: 12pt; text-align: center; color: red;}
@bottom { content: counter(page); }
}

@page:first {
@top-center { content: normal; }
@bottom { content: normal; }
}

body
{
font-family: Times New Roman;
font-size: 12pt;
}

h1
{
flow: static(header); font-size: 12pt; text-align: center;
}

h1,h2,h3,h4,h5
{
clear: left;
}

h2
{
display: block;
float: left;
margin-top: 12pt;
font-size: 12pt;
font-weight: bold;
text-transform: uppercase;
counter-increment: h2;
color: Red;
}

h2:before {
content: counter(h2, upper-roman) “.”;
margin-right: 0.25in
}

h2
{
position: relative; left: -0.2in;
}

table
{
width: 100%;
float: left;
clear: left;
}

table.four td
{
width: 25%;
}

table tr
{
margin-top: 12pt;
}

td.elementLabel
{
width: 35%;
}

td.elementValue
{
width: 65%;
}

table td
{
vertical-align: top;
}

ol
{
clear: left;
}


img {
content: attr(“src”, url);
}







This message was posted using Page2Forum from Saving Documents - Aspose.Words for .NET and Java

Hello!<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for your interest in Aspose.Words.

Import of CSS style sheets is supported only partially. In general you can look what features are supported by exporting to HTML format with embedded or external CSS style sheet. Most of exported features are also round-tripped on import. The issue with CSS support is known as #40 in our defect database.

CSS3 paged media is not supported. We plan to do this in the future but seemingly not soon. It is logged as #8559. If you’d like to specify page setup in the style sheet you can write like this:

@page Section1

{

size:595.3pt 841.9pt; margin:56.7pt 42.5pt 56.7pt 85.05pt

}

div.Section1 { page:Section1 }

… and in the code:

This approach is used on import and export by Aspose.Words and Microsoft Word.

From your style sheet I see that only a little is supported. We currently work on CSS import but it is quite a complex language and we cannot promise to support everything of it. We can consider workaround on some particular features on CSS if you’d like to. If so please attach document samples with essential cases. Sorry for inconvenience.

Regards,

Are there any news on the CSS3 support?


Bye Jochen

Hi Jochen,


Thanks for your inquiry. Could you please attach your sample HTML file here for testing? We will investigate the issue(s) on our end and provide you more information.

Best regards,