Hi,
I am using the latest Version of Aspose.Cells and using .Net .
I exported a file in pdf and excel format by using these code:
workbook.Save("fullPath",SaveFormat.Xlsx);//for test only
workbook.Save("fullPath", SaveFormat.Pdf);//for expected output
however, the two result is different. the row A13 in the file with pdf format has a higher height (About 2 row) and The row A13 in the file with excel format has 1 row height.
The result of excel is the result i want, but i need to export as pdf.
@NickMina,
Thank you for your query.
You have shared the output files however the source template file is not shared which is saved as XLSX and PDF. Please share the source template file for our testing.
@NickMina,
We were able to observe the issue by using your output XLSX file again, 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.
@NickMina,
Row 13 is auto height, when the source file is opened in Microsoft Excel, Excel will automatically autofit the height of the rows that are auto height.
Using the following code, it will be OK:
Workbook workbook = new Workbook(srcFile);
foreach(Worksheet sheet in workbook.Worksheets)
{
sheet.AutoFitRows(true);
}
workbook.Save(output.pdf);
Good to know that your issue is sorted out by the suggested lines of code. Feel free to write us back if you need further help or have some other issue or queries, we will be happy to assist you soon.