@xhaixia,
We have evaluated your issue a bit. Using the following code:
Workbook wb = new Workbook("a.xlsx");
System.out.println("Default Font: " + wb.getDefaultStyle().getFont());
Worksheet sheet = wb.getWorksheets().get(0);
System.out.println("Cell B1 Font: " + sheet.getCells().getStyle().getFont());
sheet.autoFitRow(0);
System.out.println("Row 1 Height in pixels: " + sheet.getCells().getRowHeightPixel(0));
wb.save("out.xlsx");
wb.save("out.pdf");
You will find that the workbook’s default Font is “宋体”. It is a Chinese font. So please set default edit language of Microsoft Excel to “Chinese(PRC)” (see attachment “default_edit_language.png”). Then you can manually autofit Row 1 of the source file (“a.xlsx”) in Microsoft Excel, you can see the auofitted row height is 416 pixels (see attachment “Microsoft_Excel_autofit_row.png”) which is same as Aspose.Cells does. Then in the Microsoft Excel PrintPreview, you will see the text is also cut off (see attachment “Microsoft_Excel_printview.png”).
So this is not an issue.
In other words, when you autofit row in Microsoft Excel, it does not guarantee that the text will not be cut off in printview.
Note: Make sure that the font “宋体”(“SimSun”) is installed.
Microsoft_Excel_autofit_row.png (108.0 KB)
Microsoft_Excel_printview.png (141.8 KB)
default_edit_language.png (138.6 KB)