ASPose.Cells cannot convert an Excel file to PDF correctly

One row was not set as wide as it looks in Excel.
But Microsoft.Office.Interop.Excel or Forxit can convert correctly,
A test excel file has been attached in Test.zip

P1.png (83.9 KB)
Test.zip (51.6 KB)

Thanks

@linusshen,

Thanks for the template file and screenshot.

After an initial test, I am able to reproduce the issue as you mentioned by converting your template file to PDF file format. I found that one row is not rendered as wide as in worksheet in Excel PDF rendering. I have logged a ticket with an id “CELLSNET-46913” for your issue. We will look into it soon.

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

@linusshen,
Please use the following code, it will be OK.

Workbook wb = new Workbook(srcFile);

foreach(Worksheet sheet in wb.Worksheets)
{
    //only auto fit the rows that are auto height(not customed height)
    sheet.AutoFitRows(true);
}

wb.Save(outFile.pdf);

The highlighted row is Row 11, it is auto height and the cached row height is not right. When the source file(“Test.xlsx”) is manually opened in Microsoft Excel, Microsoft Excel will recalculate the row height.

Let us know your feedback.

1 Like

Hi all thanks for the reply, yes it can solve the problem.
However I have another issue to report

See in my new zip file, there is a line ROW 16th, ASPose cannot convert it right.
The text should be able to be held in the cell , in print Preview or with Interop “Wrap Text” won’t happen. But ASPose did a Wrap Text ( this is not related with the above solution,sheet.AutoFitRows(true):wink: , looked like ASPose treated last character as an exceeded one…

Can you help to look at it?
SEQ193277-[R00].zip (92.1 KB)

@linusshen,
After an initial test, I am able to reproduce the issue as you mentioned by converting your template file to PDF file format. I have logged a ticket with an id “CELLSNET-46920” for your issue. We will look into it soon.

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