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

Free Support Forum - aspose.com

Borders appear on inserted image

Hi there,

I currently encounter an issue about image border. I used the following code to input a logo to header, but the inserted image has a very tiny border when saving the word file to pdf. Can anybody give me advice to remove it? Our current version is 10.7.0. (Word - java)

InputStream stream = getClass().getResourceAsStream("…/resource/carrierlogo-wm.png");
Shape shape = null;
    shape = builder.insertImage(stream);
catch (Exception e)

ImageSize imageSize = shape.getImageData().getImageSize();
shape.setWidth(imageSize.getWidthPoints() * 1.0);
shape.setHeight(imageSize.getHeightPoints() * 1.0);

Thanks a lot,

Hi Sheng,

Thanks for your inquiry. You’re using a very old version of Aspose.Words for Java; I would suggest you please upgrade to the latest version of Aspose.Words (13.5.0). You can download it from the following link:

I hope, this helps.

Secondly, if the problem still remains, please attach your logo image and output PDF document showing the undesired behaviour here for testing. I will investigate the issue on my side and provide you more information.

Best regards,