title: HTML-to-RTF document conversion, preserving classes as styles
body: <p>I need a <em>HTML2RTF</em> tool,  that is, a software that converts HTML format to RTF format... But not "any convertion": I need to preserve the HTML <code>class</code> attributes (ex. of paragraphs) as MS-Word "styles". </p>
  
  <p>My first option was some terminal command of LibreOffice, like </p>
  
  <pre><code>libreoffice --convert-to
  </code></pre>
  
  <p>because LibreWriter have the bigger community and suppose the best software convertion... But disappointed because not preserve class attributes as styles, even when testing as user in the graphical interface.</p>
  
  <p>I need a Linux solution (also <em>abiword</em> not solved)... Or, last option, a webservice to easy plug in a intranet's Windows server.</p>
  
  <hr>
  
  <p><strong>Input sample:</strong> </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
     &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
     &lt;title&gt;sample1 doc&lt;/title&gt;
     &lt;!-- no style need, but can be declarated with anything, don't matter --&gt;
     &lt;style type="text/css"&gt;
       .myStyle1 {color: #F00;}  .myStyle2 {color: #880;}
       .a {color: #00F;} .b {color: #088;}
     &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;&lt;!-- important to preserve class names --&gt;
    &lt;p class="myStyle1"&gt;Hello in &lt;i&gt;style#1&lt;/i&gt;. 
       &lt;span class="a"&gt;SPAN S1&lt;/span&gt;.&lt;/p&gt;
    &lt;p class="myStyle2"&gt;... Hello in style#2...&lt;/p&gt;
    &lt;p class="myStyle1"&gt;Bye &lt;span class="b"&gt;S2&lt;/span&gt;.&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>In MS-Word this sample is imported and looks ok, with styles where was classes.
  In LibreOffice (and <code>libreoffice</code> terminal tools) not.</p>
  
  <p><strong>So, there are another tool for LibreOffice?  There are a tool for Linux?</strong></p>
  
  <p>PS: last possibility, if none for Linux, a <em>webservice</em> for Windows and MS-Office.</p>