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

Free Support Forum - aspose.com

Shape doesn't preserve aspect ratio when save to PDF

Workbook wb = new Workbook("C:/ShapePic.xlsx");

Which in excel is 269 * 269

in PDF is 255 * 270

Hi there,

Thank you for the sample.

I have tried the conversion process while using the Aspose.Cells for Java 16.12.5, and I am able to notice that the shape is slightly different in the PDF as compared to the original shape in spreadsheet, however, I am not sure how to measure the shape’s size in PDF. Could you please provide more details in this regard as well as a snapshot showing the shape size in PDF for elaboration?

I just use some program to take screenshot and then measure the width/height of the circle.

Hi Xiong,

Thank you for sharing the details. Please note, I have used the Adobe Acrobat Pro’s Distance Tool to measure the width of the shape in the PDF, and I am able to notice that the width is 1.31 inches in PDF whereas it is 1.29 inches in source spreadsheet. Based on these test results, I have raised an incident with the product team as CELLSJAVA-42139, and have shared above details for thorough analysis. Please spare us little time to further evaluate the scenario and get back with updates in this regard.

Hi again,

This is to update you that we have looked further into the matter logged earlier as CELLSJAVA-42139. Please note, if you convert the provided sample to PDF manually with Excel application, the aspect ratio isn’t kept for the shapes. As the current behavior of Aspose.Cells mimics the Excel application therefore it is not an issue with the API.

Thank you for your understanding.