The problem of Excel automatic Line-Changing

My excel is automatic system generation,when excel sets up many lines and a cell to wrap automatically. After generating pdf, only the first line has wrap at present, and the last few lines have not wrap automatically.such as attachments (aspose problem 1.png)
I found some information on the Internet about setting AutoFitRows () for Worksheets, because the excel template allows users to set the height of a line by themselves. If AutoFitRow is set for the whole, when the cell text does not need for automatic line break.The height of a line set by the user itself will fail without the need for automatic line-changing, such as attachments (aspose problem 2.png)
this is my code
Workbook workbook = new Workbook(sourcePath);
workbook.Save((targetPath), Aspose.Cells.SaveFormat.Pdf);


Thanks for the template files, screenshots and PDF files.

We will check your issues and get back to you soon.


Please try to AutoFit the rows with Aspose.Cells API and then let us know your feedback.

Workbook workbook = new Workbook("1000050_1007_798607.xls");
Worksheet workSheet = workbook.Worksheets["ECS-20190327-000008"];
workbook.Save("1000050_1007_798607.pdf", SaveFormat.Pdf);

Thank you, this method is feasible, but there is still a problem, the size of the picture is different, excel pictures are set to adaptive, PDF pictures seem too (177.8 KB)

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

CELLSNET-46663 - Image size changed while converting XLS to PDF after calling AutoFitRows(true)


We have investigated your issue a bit. The row height is auto matched and the stored row height in the file is not correct. MS Excel will automatically auto fit the row height when opening the file, then the row height will expand too. Aspose.Cells will work as MS Excel later.

So how can I solve this problem?


MS Excel adjusts the height while opening or viewing the file otherwise stored height is not correct. So I am afraid this difference can not be fixed for now and will be taken care later.


Please try our latest version/fix: Aspose.Cells for .NET v19.3.3 (attached)

Your issue should be fixed in it. See the following sample code for your reference:
Sample code:

             LoadOptions options = new LoadOptions();
            AutoFitterOptions fitOptions = new AutoFitterOptions();
            fitOptions.OnlyAuto = true;
            options.AutoFitterOptions = fitOptions;
            Workbook workbook = new Workbook(Constants.sourcePath + "CellsNet46663.xls", options);

Let us know your feedback.
Aspose.Cells19.3.3 For .Net2_AuthenticodeSigned.Zip (4.8 MB)
Aspose.Cells19.3.3 For .Net4.0.Zip (4.9 MB)

The issues you have found earlier (filed as CELLSNET-46663) have been fixed in Aspose.Cells for .NET v19.4. This message was posted using BugNotificationTool from Downloads module by Amjad_Sahi