Cell setting auto wrap to PDF data display incomplete

Cell settings are not fully displayed when converting from word wrap to PDF, but can be displayed normally when converting to html
image.png (57.5 KB)
image.png (24.7 KB)
image.png (45.0 KB)

this is my excel:EPPR_56822.zip (65.4 KB)

this is my code:

Workbook workbook = new Workbook("D://Aspose//EPPR_56822//EPPR_56822.xlsx");
workbook.save("D://Aspose//EPPR_56822//EPPR_56822", SaveFormat.HTML);
workbook.save("D://Aspose//EPPR_56822//EPPR_56822.pdf",  SaveFormat.PDF);

@xhaixia,

Thanks for the template file, output files and screenshots.

If you could save your Excel file to HTML (Web page) and PDF in MS Excel manually, you will also notice this issue. This is due to those merged cells and MS Excel cannot wrap text for merged cells. But Aspose.Cells does provide relevant API to auto-fit merged cells for wrapping text/data. Please try the following (updated) sample code, it will work fine:
e.g.
Sample code:

Workbook workbook = new Workbook("D://Aspose//EPPR_56822//EPPR_56822.xlsx");

AutoFitterOptions options = new AutoFitterOptions();
options.setAutoFitMergedCellsType(AutoFitMergedCellsType.EACH_LINE);
workbook.getWorksheets().get(0).autoFitRows(options);

workbook.save("D://Aspose//EPPR_56822//EPPR_56822", SaveFormat.HTML);
workbook.save("D://Aspose//EPPR_56822//EPPR_56822.pdf",  SaveFormat.PDF);

Hope, this helps a bit.

Thank you for your method, but it is verified that there are still some problems with column width calculation. For example, the parts marked below have data through the pdf editor, but they are not displayed on the pdf

image.png (38.8 KB)
image.png (26.2 KB)

@xhaixia
We log it with issue ID “CELLSNET-52192”. We will look into it soon.

@xhaixia
Please save the xlsx file as pdf file in MS Excel, you will find same result as Aspose.Cells.