PDA

View Full Version : Unable to view HTML with styles using HTMLEditor



talha06
23 Jan 2013, 1:51 AM
Hi everyone,

I'm getting content of .doc file with Java; it gives me separated styled HTML, has style classes defined above the body. When I set this generated HTML text to this editor, it gives me plain text and shows style definitions too. I need to import this .doc file's content into HTML editor with proper styles. As an information, converted HTML has right syntax, when I create a sample .html file to test it everything is ok.

I'd like to learn if I'm missing something or HTMLEditor only support in-line style HTML.
Here's a converted HTML that I got from .doc file:


<html>

<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
.b1 {
white-space-collapsing:preserve;
}
.b2 {
margin: 1.1798611in 1.1798611in 1.1798611in 1.1798611in;
}
.s1 {
font-weight:bold;
color:black;
}
.s2 {
color:black;
}
.s3 {
font-style:italic;
color:black;
}
.p1 {
text-align:center;
hyphenate:none;
font-family:Times New Roman;
font-size:12pt;
}
.p2 {
text-align:justify;
hyphenate:none;
font-family:Times New Roman;
font-size:12pt;
}
.p3 {
text-align:end;
hyphenate:none;
font-family:Times New Roman;
font-size:12pt;
}
</style>
<meta content="talha " name="author">
</head>

<body class="b1 b2">
<p class="p1">
<span class="s1">Letter</span>


</p>
<p class="p2"></p>
<p class="p2">
<span class="s2">Paragraph</span>


</p>
<p class="p2"></p>
<p class="p2">
<span class="s2">Sample </span>


</p>
<p class="p2"></p>
<p class="p2">
<span class="s2">Third One</span>


</p>
<p class="p2"></p>
<p class="p2"></p>
<p class="p3">
<span class="s2">Regards</span>


</p>
<p class="p3">
<span class="s2">blablbla</span>


</p>
</body>


</html>


Thanks in advance.

friend
23 Jan 2013, 10:43 AM
You'll note that the first line of the Ext.form.field.HtmlEditor (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.HtmlEditor) states that this component "Provides a lightweight HTML Editor component'.

Check the component's source (http://docs.sencha.com/ext-js/4-1/source/HtmlEditor2.html#Ext-form-field-HtmlEditor) for more info.

talha06
23 Jan 2013, 11:01 AM
I've also tried TinyMCE extension (http://www.point-constructor.com/en/tinyta/) that is developed by Oleg Schildt. Result is same. Problem is that HTMLEditor isn't able to parse separated defined css classes; so all styles should be defined in-line.