Free Support Forum - aspose.com

Row height isn't maintained after you save an xlsx file in pdf

Hi,

I found a problem while using Aspose Cells.

I made an example which explains my problem better.

I have an xlsx file, when I open the file and save it in pdf with Aspose, the row height isn't maintained.

Thanks,

Devid

Hi,


Please add the following two lines to your code before converting to PDF format, it will fix your issue:

Sample code:

workbook.Worksheets[0].AutoFitColumns();
workbook.Worksheets[0].AutoFitRows();


Thank you.

Hi,

Posting method AutoFitRows() could possibly cause problems.
Are you going to solve the problem so it isn't necessary to use that method with the next official release?

Thanks,

Devid

Hi,

Thanks for your feedback.

Well, Aspose.Cells tries to convert the Excel file to PDF as per MS Excel's print preview for the sheets which it should. Since it does not work as print preview of MS Excel for the worksheet(s) and you do not intend to use workaround suggested, so I have logged a ticket with an id "CELLSNET-41577" for your issue. We will look into your issue soon.

Once we have any update on it, we will let you know here.

Thank you.

Hi,

Do you have any news about the problem?
How soon will it be fixed?

Thanks,

Devid

Hi,

Thanks for your posting and using Aspose.Cells.

We are afraid, we do not have any update for you. Once, we will have some update for you, we will share it with you asap.We have also logged your comment in our database.

Hi,

Do you have any news?

I'm still waiting.

Thanks,

Devid

Hi,

Thanks for your posting and using Aspose.Cells.

We have logged your comments in our database. Once, we will have some update for you, we will let you know asap.

Hi,

We suggest you to kindly use:


AutoFitterOptions afo = new AutoFitterOptions();

afo.OnlyAuto = true;

afo.IgnoreHidden = true;

    <span class="GINGER_SOFATWARE_correct" grcontextid="worksheet:0" ginger_sofatware_markguid="45eda990-d76b-4690-9053-9217703be8c1" ginger_sofatware_uiphraseguid="9b0c19ce-2c93-49a3-b8c3-f3d91b54c12f">worksheet</span><span class="GINGER_SOFATWARE_correct" grcontextid=".:1" ginger_sofatware_markguid="5089b246-0be2-413b-b465-d5e44969c9fd" ginger_sofatware_uiphraseguid="9b0c19ce-2c93-49a3-b8c3-f3d91b54c12f">.</span>AutoFitRows<span class="GINGER_SOFATWARE_correct" grcontextid="(:2" ginger_sofatware_markguid="9716e555-9377-4895-9eb7-bd05feaff6cb" ginger_sofatware_uiphraseguid="9b0c19ce-2c93-49a3-b8c3-f3d91b54c12f">(</span><span class="GINGER_SOFATWARE_correct" grcontextid="afo:3" ginger_sofatware_markguid="31f43f05-d9d9-47b9-85b7-0737f9f6387a" ginger_sofatware_uiphraseguid="9b0c19ce-2c93-49a3-b8c3-f3d91b54c12f">afo</span>);<br>


this way will do the same thing as per MS Excel.<o:p></o:p>

Please also try our latest fix/version: Aspose.Cells for .NET v7.4.3.1