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.
Unfortunately, activation email could not send to your email. Please try again.

Convert Word Document with images to HTML

Thread ID:

Created:

Updated:

Platform:

Replies:

125597 Aug 26,2016 09:27 AM Aug 29,2016 08:32 AM Windows Forms 1
loading
Tags: DocIO
Danny Lloyd
Asked On August 26, 2016 09:27 AM

I am attempting to convert a word document, which contains images, to HTML.  The resulting HTML will be used as the body for sending email using System.Net.Mail.SmtpClient. 

I tried this with version 11 and DOCIO was embedding the images as data:image/png;base64.....  The images would not appear in the email, they showed as a red X.  I could save the email as HTML and view the image properly.

I upgraded to the latest version 14 release to see if I could get this working.  When I save the word document to html, I am using the save option to save it to a memory stream.  DOCIO is creating an _images folder that contains the images in the document.  The resulting email cannot show the images since they are not embedded in the email.

I am thinking that the references in the html need to use CID.  I am trying to determine if I will have to do this manually or if this is something that DOCIO can do for me.

Do you have a recommendation or sample that shows how to use DOCIO to convert a document to html and use that to produce an email with embedded images?

Dan

Ayswarya Krishna Kumar [Syncfusion]
Replied On August 29, 2016 08:32 AM

Hi Danny,

Thank you for contacting Syncfusion support.

With the provided details we have determined the working scenario of your requirement. Please find the following steps.
1) Convert the Word document to HTML – using DocIO.
2) The converted HTML string will be given as EMAIL textbody content – using SmtpClient.

We have prepared the sample to meet your requirement and attached the same for your reference. In the sample we have embedded .JPEG images into the HTML file and sent the same HTML content as the mail using LinkedResource of SmtpClient. Try running the sample and let us know whether it helps?

Sample link:
http://www.syncfusion.com/downloads/support/forum/125597/ze/GenerateWord_Windows-810814077.zip

Regards,
Ayswarya


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.

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.

;