LINQ Reporting Engine - Unable to fit high resolution image while using aspose word linq syntax

Using Aspose word (version:23.3) java, trying to add image in textbox and its works if its low resolution image, but when we are trying add high resolution image it started giving error - **Exception in thread “main” com.aspose.words.internal.zzYlt: Could not create the bitmap with the specified parameters. Possible lack of system resources.: Parameter is not valid. FileFormat =0

And I want all images to be fit in text box size what i have attached below. do we have some mechanism to decrease the size at runtime or fit the image in text box irrespective of considering image resolution.

working image source - https://mys-ae.bnymellon.net/admin/api/v1/s3/download/Thu_Apr_20_08_54_16_EDT_2023_Polaris.jpg

Not working image source : https://mysourcesocial.bnymellon.net/servlet/JiveServlet/showImage/38-88130-1481069/lab%20.png

Please look into this and let me know if is there any way to fix this.

**

@aspwanupsinha Unfortunately, the links to the images are no accessible. Could you please attach the problematic image here for testing or share it via google drive if it is too large for the forum.

not working image - lab .jpg (377.6 KB)

@aspwanupsinha Thank you for additional information. Unfortunately, I cannot reproduce th eproblem on my side. Here is a simpel code I have used for testing:

Document doc = new Document("C:\\Temp\\in.docx");
        
ReportingEngine engine = new ReportingEngine();
engine.buildReport(doc, "C:\\Temp\\in.jpg", "imgPath");
        
doc.save("C:\\Temp\\out.docx");

Here is the template: in.docx (14.9 KB)

Yes, In localhost if the image is stored locally then it looks good. But when the same resolution image we are trying load from web/any external storage its start failing.
To reproduce this scenario point ant google image url which has resolution 1650x990 and more.
Any way to compress to image during runtime using linq engine syntax?

@aspwanupsinha Unfortunately, I still cannot reproduce the problem onmy side. I have uploaded your image to google drive and used the following code for testing:

Document doc = new Document("C:\\Temp\\in.docx");
        
ReportingEngine engine = new ReportingEngine();
engine.buildReport(doc, "https://drive.google.com/uc?export=view&id=19ZvAke0u2uuNMlG-gaTPxu7m4oWDYrai", "imgPath");
        
doc.save("C:\\Temp\\out.docx");

The image is properly inserted into the template.

A post was split to a new topic: Support 10-12 different language in our ms-word template