question

JayashriV avatar image
0 Votes"
JayashriV asked ·

Loss in image quality while saving Word document as Filtered Web Page?

I am writing a Word to HTML converter. I am using the approach of saving Word file as Filtered HTML to carry out the conversion. I have automated this process using Microsoft.Office.Interop.Word for every Word document input that has to be converted. But, I see that the images are getting compressed regardless of the settings explained in office-docuemnt-image-quality-loss . The quality of screenshot images embedded in the word document becomes very poor after conversion to filtered html.


Unfortunately, manual replacement of the images with the original quality images cannot be done because of the sheer volume and size of the word documents. Zipping the docx file and accessing the native images does not help me, as these images are differently numbered from the filtered html images. The order is especially affected when shapes and icons are present in the word file.


Is there any way to remove such compression and have the image quality same as the original embedded images? Or, is there a better way to convert Word documents to HTML retaining the image quality?


office-vba-devoffice-word-itprodotnet-runtimedotnet-standard
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JohnKorchok avatar image
0 Votes"
JohnKorchok answered ·

PDF has good support in browsers. You could export as that format to retain the image quality.

· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, I am required to generate the HTML corresponding to each Word document. Hence, PDF will not meet the requirement.

0 Votes 0 ·
DanielZhang-MSFT avatar image
0 Votes"
DanielZhang-MSFT answered ·

Hi JayashriVenkatachalam,
I have a suggestion that you can simply add the html code yourself to link the image from the source file, so you don't need to convert it.

 <img src="img.jpg" alt="image description">

Best Regards,
Daniel Zhang


If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.