We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Converting HTML to Word Doc - Css support?

Thread ID:

Created:

Updated:

Platform:

Replies:

149459 Apr 22,2014 01:36 PM UTC Nov 27,2019 09:44 AM UTC ASP.NET Web Forms 10
loading
Tags: DocIO
Andy Siantonas
Asked On April 22, 2014 01:36 PM UTC

Hi

We are attempting to insert html into a word document using paragraph.AppendHTML(html).

This works fine except that <style> tags don't seem to work. Inline styles work, but normal style selectors and classes do not:

This works (the text is red):
<div style="color:red;">this text should be red</div>

This does not (the text is not red):
<style>
            .mydiv {
                color: red;
            }
</style>
<div class="mydiv">this text should be red</div>

Does DocIO support any style tag conversion at all when it imports html? If not, what is my best approach for creating universal styles for an html based word document?

Sathish K [Syncfusion]
Replied On April 23, 2014 03:44 PM UTC

Hi Andy,

 

Thank you for your interest in Syncfusion products.

 

Currently DocIO doesn’t have support to preserve CSS in HTML to Word document conversion. We have logged this as a feature request in our database. We will implement this feature in any of our upcoming releases. We usually have an interval of at least three months between releases. The feature implementation would also greatly depend on the factors such as product design, code compatibility and complexity. We will update you when this feature has been implemented.

 

As a workaround kindly define all the styles inline to preserve desired styles during the conversion process.

 

Please let us know if you have any other questions.

 

Regards,

Sathish


Chris Crowhurst
Replied On September 11, 2014 11:41 AM UTC

Hi,

I am experiencing the same issues as Andy.

Does the latest version support CSS in HTML, or is this still to be implemented ? I am currently using Essential Studio 12.1.0.43?

Regards

Chris

Jan
Replied On February 12, 2016 04:03 PM UTC

Hi,

any updates or still not supported?

Regards,
Jan

Sarathkumar V [Syncfusion]
Replied On February 15, 2016 09:22 AM UTC

Hi Jan,

Thank you for using Syncfusion products.

DocIO still doesn’t have support to preserve CSS in HTML to Word document conversion. We have logged this as a feature request in our database. We will implement this feature in any of our upcoming releases. We usually have an interval of at least three months between releases. The feature implementation would also greatly depend on the factors such as product design, code compatibility and complexity. We will update you when this feature has been implemented.

As a workaround kindly define all the styles inline to preserve desired styles during the conversion process.

Regards,
Sarath


Peruri Srinivasulu
Replied On September 22, 2016 12:54 AM UTC

Hi,

Is it implemented now? Any update on this?

Thank you.

Priyanga Elangovan [Syncfusion]
Replied On September 22, 2016 06:01 AM UTC

Hi Andy,

Thank you for contacting Syncfusion support.

DocIO still doesn’t have support to preserve CSS in HTML to Word document conversion. We have a plan to implement this feature in any of our upcoming releases. The feature implementation would also greatly depend on the factors such as product design, code compatibility and complexity. At the moment we are unable to provide concrete timeline for adding this support. We will let you know once this feature has been implemented.

As a workaround kindly define all the CSS styles as inline to preserve desired styles during the conversion process.

Regards,
Priyanga.E
 


Trevor Nguyen
Replied On July 30, 2019 10:56 PM UTC

Has CSS support been implemented? Thanks...


Poorani Rajendran [Syncfusion]
Replied On July 31, 2019 10:39 AM UTC

Hi Trevor,

Thank you for contacting Syncfusion support.

Currently DocIO doesn’t provide full-fledged support for CSS style sheet in HTML to Word conversion. This feature is to preserve CSS styles while importing HTML files is supported with limited CSS selectors.
The following CSS selectors are supported in Essential DocIO's HTML import functionality at present,
1. IDSelector
2. ClassSelector
3. DescendantSelector
4. ElementSelector
5. ChildSelector

Kindly provide us your input HTML file so that we can analyze further in line with your requirement and provide appropriate solution at the earliest.

Please let me know if you have any other questions.

Regards,
Poorani Rajendran


Tawani Anyangwe
Replied On November 26, 2019 10:03 PM UTC

Has this feature been implented? Does DocIO now support CSS classes?

Poorani Rajendran [Syncfusion]
Replied On November 27, 2019 09:44 AM UTC

Hi Tawani,


Thank you for contacting Syncfusion support.


As mentioned in our previous update (Updated on 7/31/2019), this feature is to preserve CSS styles while importing HTML files is supported with limited CSS selectors (which is mentioned in our previous update). Still, DocIO doesn’t provide full-fledged support for CSS style sheet in HTML to Word conversion. We don’t have any immediate plans to implement this feature. We will let you know when this feature is implemented.

Please let me know if you have any other questions.


Regards,
Poorani Rajendran.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon