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

Free Support Forum - aspose.com

Adjust Office Math Formula Equation or Image Size (Width Height) in Word Document using C# .NET

I use “FontChanger” to adjust font size, but the formula(or image) in the document cannot be adjusted together, resulting in font size inconsistency between the text and formula(or image). How can I solve this problem? Thank you

TIM图片20200313145835.jpg (54.6 KB)

test.zip (286.3 KB)

@lingengliang,

The following code will help you to adjust the size of Shape nodes in Word document:

Document doc = new Document("E:\\Temp\\TEST\\in.docx");

foreach (Shape shape in doc.GetChildNodes(NodeType.Shape, true))
{
    shape.AspectRatioLocked = true;
    shape.Width = shape.Width * 2; // double the size of shapes
}

doc.Save("E:\\Temp\\TEST\\20.3.docx");

@awais.hafeez
When there are many pictures, this method will take a lot of timetest.zip (1.3 MB)

@lingengliang,

Please create a standalone simple and runnable Console application (source code without compilation errors) that helps us to reproduce your 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. We will then start further investigation into your scenario and provide you more information. Thanks for your cooperation.