LINQ Reporting Engine: inserting html with images: bad image resizing

Dear Aspose support,
under certain circumstances (and it is unclear when these circumstances happen) images embedded in HTML are not properly sized when HTML is inserted into a Word document via LINQ reporting engine.

This is a simplified example: (39.1 KB)

In the archive there is the word template (just a single tag for inserting html) and the source html (embedded inside an xml container).
The HTML contains a single image: in the output such image is inserted into Word at 200% scaling, but I see no reason why.
Also, it seems that any styling on the image is ignored; in the provided example, the style is in the HTML’s HEAD section as an embedded CSS but also other methods do not work (e.g. providing custom style attribute to the given image tag).
So, basically, the request for support is about these two points:

  • why is the image inserted at 200% scaling?
  • why any provided (embedded) style is ignored?

Thanks in advance for your support,
Any workaround is also appreciated,
Kind Regards

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-25134

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@fabrizio.vaglia as a workaround you can use the width property instead of the max-width property in your css class:

img {
    max-width: 16cm !important;
    border-color: black;
    border-width: 5px;
    width: 16cm;

thanks for the response, please note however that this is not a workaround, because if there are small images they can be sized as per their orginal properties.
Instead the use case is to properly resize images which are too big and risk to be truncated at the page edge.


1 Like

The issues you have found earlier (filed as WORDSNET-25134) have been fixed in this Aspose.Words for Java 24.2 update.