We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Issue with SaveAsPDF with long text in a single cell

Hi,

I have found an issue when a large number of characters is in a single cell and the cell contains word wrap, it appears to not print the contents of the cell correctly. Some of the beginning text is cut off. (See attachment: Print Bug.xlsx and Print Bug.pdf).

There also appears to be an issue when word wrap is off and the column is expanded to display all the characters. It seems the text is cut off and it does not continue printing the rest of the text on a different page. (See Print Bug 1.xlsx and Print Bug 1.pdf)

Print bug.zip (81.4 KB)

Let me know if you any more details regarding this issue.

Thanks.

Nick

@px_brass,

I have tested the scenario by creating PDF files using Aspose.Cells for .NET 19.3.x and Excel 365 for comparison but I could not observe any noticeable difference. Could you please create PDF files using Excel and share the difference details along with images for our reference? We will analyze the information and provide assistance accordingly.

Hi,

I tried to make the samples clearer. I have attached the PDF generated from Aspose and Excel. With the Print bug 1 case, it seems Excel has an issue saving to PDF as well, to get the desired results I had to print the excel workbook using the ‘Microsoft Print to PDF’ printer and it produced the correct output. Notice the PDF in the Excel case has 3 pages while from Aspose there is only a single page.

I have attached images comparing the PDFs side by side for both Print Bug and Print Bug 1 cases.

Print bug.zip (296.9 KB)

Let me know if the problem is still not clear and I can provide more detailed steps if needed.

Thanks!

@px_brass,
We were able to observe the issue where Aspose.Cells creates single page in PDF instead of 3. We need to look into it more and have logged the issue in our database for investigation and for a fix (if applicable). Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSNET-46661 - Less number of pages rendered in PDF as compared to Excel 365 

Regarding the issue in “Print bug.xlsx”, I have converted the Excel file to PDF using Aspose.Cells and Excel 365 both. It is observed that both the outputs are same (as expected) because Aspose.Cells mimics the behavior of Excel 365. Therefore it does not seem to be an issue with Aspose.Cells. On the other hand if we auto set the row height in the sheet using Excel and then convert it to PDF using Excel and Aspose.Cells both, then again the output PDFs are similar. Please check this behavior and share your thoughts with us.

Hi,

Thanks for confirming one of the bugs.

For the “Print bug.xlsx” I have attached an image which highlights the issue. I tried to circle the areas where that are problematic.

MoreDetail.PNG (100.3 KB)

From Aspose.Cell to PDF the text appears to be cut off \ overlapped with other cells, despite word wrap being on and the excel workbook expanding the row height to displaying all the text.

I tested in version 19.3 of Aspose and it still seems to be an issue. I am not sure if there is a slight difference in our tests. Please let me know if you see the issue in the image.

Thanks.

Nick

@px_brass,

I have performed following two tests:

Case 1:

  1. Open “Print bug.xlsx” in Excel

  2. Save it as PDF with name like “Print bug-SavedAsPDFByExcel.pdf”

  3. Open “Print bug.xlsx” using Aspose.Cells and save it as PDF with name like “Print bug By Aspose 19.3.pdf” using following code:

    Workbook wb = new Workbook(@“Print bug.xlsx”);
    wb.Save(@“Print bug By Aspose 19.3.pdf”);

  4. Both the PDF files are compared but no difference is observed as per the expectation because Aspose.Cells is creating same output as created by Excel. We are not comparing the results with the output created by “Microsoft Print to PDF”. Here both the PDF files show cut off/overlapped text.

  5. Here are the output files:
    Print bug By Aspose 19.3.pdf (83.6 KB)
    Print bug-SavedAsPDFByExcel.pdf (104.7 KB)

Case 2:

  1. In this scenario the “Print bug.xlsx” file is opened in Excel and rows are auto fitted then saved back on disc. Now all the steps in Case 1 are repeated with this modified file which produces similar outputs at the end where no text is cut off/overlapped.

Please check is there is some difference in the testing and share your feedback.

Hi,

The result in Print Bug By Aspose 19.3.pdf is exactly the problem we are having. It sounds like we are getting different results from Excel. When I open the excel workbook in my environment (without auto fit applied) I see excel printing the expected results. In excel all the data is visible for me without autofit, simply by opening the file.

I have reattached the workbook, an image of how I see the cells in Excel and the PDF it generates.

Print bug.zip (48.7 KB)

Nothing is cut off in Excel so I would expect Aspose to produce the same results as what I see when I view the Excel workbook. I am on version 16.0.11328.20156 of Excel for Office 365 in case it makes a difference. I don’t quite understand why would see different result from Excel.

Please let me know you are able to produce the results I am experiencing from Excel.

Thanks.

Nick

@px_brass,

Although we could not observe this behavior in Excel where correct text is displayed without using autofit option, however we need to look into it more. We have logged the issue in our database for investigation and for a fix(if applicable). Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSNET-46666 - Text is cutoff/overlapped while saving Excel file as PDF

@px_brass,

We have investigated your issue a bit. When we change the DPI setting to 125%, we get the same output as the your. You can find that the last word “text” in cell is cut off in this case.

Currently, Aspose.Cells can get the same output as Microsoft Excel with DPI setting to 100% .

Let us know your feedback.

Hi,

I don’t quite understand why this setting would change the location \ cut off point of each cell. I think the goal of comparing to Excel was to demonstrate the expected result. The idea is if you can see all the text of the cell when viewing the worksheet, the expectation is that it will print \ save to pdf in the same fashion (not cut off). If that is not the case whether it is through Excel or Aspose our belief is that it is a bug.

I would hope it can be fixed in Aspose even if Excel acts differently.

Thanks.
Nick

@px_brass,

I am afraid that as Aspose.Cell mimics the behavior of Excel, therefore it is not possible to provide a feature which is different than the Excel. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

Hi,
I just test the workbook in Excel 365 Online and see the issue. Please try the installed (native) Excel office 365 application and you should see it produces the correct results. I have to believe Excel 365 Online has a bug and installed Excel application is producing the correct results.

Thanks,
Nick

@px_brass,
We have recorded your concerns along with the ticket and will consider them while analyzing this issue in more detail. We will write back here once any feedback is ready to share.

@px_brass,

Do you mean that you can get the same output (text cut off) as we shared earlier, in your Excel 365 Online? We also tried in Excel 365 online, and got the same output as text cut off. The reason why you are getting different output in your (native) Excel office 365 application is that the DPI setting on your end is 125%. Please change the DPI setting to 100%, then relogin/restart your end/computer, then check the output/printview in your (native) Excel office 365 application again to see whether there is any difference.

@px_brass,

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

We have fixed your issue (logged earlier as “CELLSNET-46661”) now.

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

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