We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Images in rendered HTML have extra size and caused blurry output

Hi,

When converting a DOCX to HTM using Aspose.Words, I noticed an extra pixel was added to the height&width (compared to MS Word ‘save as’ HTM) and therefore caused blurry images.

Code:

var doc = new Document(@".\test2.docx");
var htmlSaveOptions = new HtmlSaveOptions();
htmlSaveOptions.ImageResolution = 192;
doc.Save(@".\out1.htm", htmlSaveOptions); // wrong size / blurry image
htmlSaveOptions.ScaleImageToShapeSize = false; // disable resolution on the image, use the original one
doc.Save(@".\out2.htm", htmlSaveOptions); // still wrong size / blurry image

The image was supposed to be 151x151 but it was rendered as 152x152 in the Aspose outputs. Because of the extra pixel, the image got blurred.

This issue doesn’t happen if I saved the DOCX to HTM with Word manually, where the size is correct as 151x151 and the picture is not blurry.

I’ve attached my test files including both Aspose and Word outputs as well as a screenshot to highlight the issue. Could you please help to take a look?

test.zip (139.4 KB)
image.png (54.7 KB)

Thanks,

1 Like

@ServerSide527,
We have tested the scenario and managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET - 23230. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.