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

Free Support Forum - aspose.com

Image formatting

I have one big issue with Aspose Words product and that is image insertion. There is no way to maintain image ratio without adjusting the Textbox size.
-fitSizeLim is fine if the image is smaller but then can cause distortion issues, when image is enlarged.

There is no way, that I have found, to tell the engine that the Textbox is the maximum space, and to fit the image within these bounds while maintaining ratio. Currently stretching the image to take up the entire space is defaulted OR adjust the Text box.

Am I missing a flag Or is this a feature I should request?

@Rohara239,

To ensure a timely and accurate response, please ZIP and attach the following resources here for testing:

  • Your simplified input Word document
  • Aspose.Words generated output DOCX document showing the undesired behavior (if any)
  • Your expected document showing the correct output. You can create expected document by using MS Word.
  • Please also create a simplified standalone console application (source code without compilation errors) that helps us to reproduce your current problem on our end and attach it here for testing. Please do not include Aspose.Words DLL files in it to reduce the file size.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

aspose-image-insert.zip (1.6 MB)
I have attached a simple spring boot app with a readme.md file explaining my issues with each image modifier as well as pdf outputs with each modifier to demonstrate my issue.

@Rohara239,

I think, you can meet your requirements by using various Shape class properties such as Shape.Width, Shape.Height and Shape.AspectRatioLocked properties. Hope, this helps.

I am more knowledgeable with the Linq reporting engine but this does look like the Shape class will solve my issue. I have one follow up question. Our Business partners manage the Linq templates. How would I get the image “Key” from the image textbox to pull the correct image in the backend?

@Rohara239,

We have logged your requirement in our issue tracking system. Your ticket number is WORDSNET-18362. We will further look into the details of this requirement/problem and will keep you updated on the status of the linked issue.

The issues you have found earlier (filed as WORDSNET-18362) have been fixed in this Aspose.Words for .NET 20.3 update and this Aspose.Words for Java 20.3 update.