Free Support Forum -

Image layout for XLSX to PDF Conversion with Aspose.Cells for Java API

Hello Aspose Team,

We have excel with multiple images. Sample excel file is attached here with name ‘WidgetAndAllCharts.xlsx’, in Display1 images are placed. These images are placed with following code.

Workbook workbook = new Workbook(“WidgetAndAllCharts.xlsx”)
Worksheet ws=workbook.worksheets.get(‘Dispaly1’)

Shape shape = ws.getShapes().get(“Section” + sectionValue + sectionPostFix) //getting shapes, sectionValue will be ‘1’ or ‘2’ to 36 and sectionPostFix will be ‘1x1’ or ‘2x2’ or ‘2x4’
int pictureIndex = ws.getPictures().add(shape.getUpperLeftRow(), shape.getUpperLeftColumn(), inputStream) //inputStream of respective image.
Picture picture = ws.getPictures().get(pictureIndex)
picture.setLeft(shape.getLeft()) (678.4 KB)


And after placing the images we are saving this in .pdf with following code, Images layout will not be same as excel, layout. Space between widgets, size of images (width) are not as expected/similar as excel file. Could you please look into this from your side.

Workbook workbook = new Workbook(“WidgetAndAllCharts.xlsx”);

workbook.calculateFormula();“myresult.pdf”); //used Display1 sheet

Thank you for your query. We are working on it and will share our findings after detailed analysis.

We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSJAVA-43007 - PDF is not generated as expected

Do you have any update on this?


There is not any update for this issue yet. Once we have an update on it, we will let you know here.


This is to inform you that we have fixed your issue now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

The issues you have found earlier (filed as CELLSJAVA-43007) have been fixed in Aspose.Cells for Java v19.10. This message was posted using Bugs notification tool by ahsaniqbalsidiqui