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

Free Support Forum - aspose.com

PDF Export Truncating Text

I'm having an issue with text getting truncated when I'm trying to save from Aspose.Cells to PDF. Heres the code I'm using:

Workbook.Save("C:\\Documents and Settings\\SPSS\\Desktop\\deleteme.pdf.xml", Aspose.Cells.FileFormatType.AsposePdf);
Aspose.Pdf.Pdf Pdf = new Aspose.Pdf.Pdf();
Pdf.BindXML("C:\\Documents and Settings\\SPSS\\Desktop\\deleteme.pdf.xml", null);
Pdf.Save("C:\\Documents and Settings\\SPSS\\Desktop\\deleteme.pdf");

It appears that the XML being created by the Workbook.Save() is the issue. If you look at the following:

-
-





-
ag

If you look at this the text for the cell is "ag", it should be "age". It is "age" when I export using:

Workbook.Save("C:\\Documents and Settings\\SPSS\\Desktop\\deleteme.xls", Aspose.Cells.FileFormatType.Excel2003);

I'm using: Aspose.Cells: 4.5.0.0

Aspose.Pdf: 3.7.0.0

Hi,

Thanks for providing us details,

Could you post your template excel file here, it will help us really to figure out the issue quickly.

Thank you.

I’ve attached the XLS file and XML file that were generated.

Hi,

Thanks for providing us the template files.

Yes, we found the truncating issue related the text (string text in the cells.....e.g.., age, gender etc.) with 90 degree orientation. We will figure out the issue soon.

Thank you.

Hi,

Please try this fix.

We have fixed this bug.

That seems to have fixed that problem, however, I think I have 3 additional problems that look like a problem in Aspose.PDF. I've attacehd the XML used to generate the PDF.

New Issue 1

If you go to page 5 of the PDF the last column "Not Answered" is being written partially below/outside the correct cell.

New Issue 2

If you go to page 9 of the PDF the "Gender of Respondent" cells on the side of the table are being written to the right/outside the correct cell. This effect gets worse with each additional heading.

New Issue 3

If you go to page 10 of the PDF you'll notice the last row of the table is significnatly taller than all the other table rows. In fact overall the row heights are not consistent, that last row just shows it the best. I think this may be a side effect of "new issue 2".

Hi,

Thanks for further details.

Could you post your template excel file here, we will check your issue soon.

Thank you.

Hi,

Thanks for your info.

In fact, the value of the cell "L5" in the worksheet "Table5" is "Not Answered". The row height is fixed and the text within a cell is wrapped, so MS Excel only display the part of the cell value. You can call "workbook.Worksheets["Table5"].AutoFitColumns()" before saving the file. You will see the value of the cell "L5" in the worksheet "Table5" is "Not Answered" in MS Excel. We hope you can call Worksheet.AutoFitColumns() before converting cells to pdf file.

We will look into this issue in Cells2Pdf too.

Hi,

Issue 2, Please try this Aspose.Pdf fix.

And could you post your template file? We will check Issue2 and Issue 3 with Aspose.Pdf together.

I've attached the template and tested the updated Aspose.Pdf. I think this the PDF looks good now.

I agree that some cell valuesappear outside the cells as the column widths are not all correctly set to hold the content correctly.