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

Free Support Forum - aspose.com

PDF Not Keeping the Wrapping

  1. I am generating an Excel spreadsheet using Aspose.cells v
    2. I have a header that is being copied and reused in the spreadsheet. The header has wrapping.
    3. When I export the spreadsheet as a PDF, the header formatting is lost.
    4. The lines on the PDF are thick and on the spreadsheet they are thin.

    Please see the samples I have attached. Please help me as soon as possible.

    GoodSpreadsheet.jpg - shows how the second header is correct
    BadPDF.jpg - shows how the second header is not wrapped after exporting to PDF
    ThickLines…pdf - shows how the line formatting are thick instead of thin.

    Also tried upgrading to 17


Could you attach the Excel file in question. Also, attach the output PDF file. We will check your issue soon.

Could you also try our latest version/fix if it makes any difference:
Aspose.Cells for .NET v17.1.7 (.NET 2.0) compiled in .NET Framework 2.0.
Aspose.Cells for .NET v17.1.7 (.NET 4.0) compiled in .NET Framework 4.0.

Thank you.

The files are attached. I did upgrade to 17 and it made no difference. The new files attached were generated with the latest Apsose.cells build.


Thanks for the template files.

I have evaluated your scenario/ case using both Aspose.Cells for .NET v17.1.7 and MS Excel (manually). Well, the borders’ thickness is not an issue as if you could take the print preview of the worksheet in MS Excel manually, it would also show thick borders in it. Also, when you render your spreadsheet to PDF via MS Excel (manually), it will show similar results as per the output PDF file by Aspose.Cells, see the attached “CullReport_MS_Excel.pdf” file for your reference. Regarding text wrapping issue for the second header, well, I can notice this issue but you can easily workaround the issue by calling Worksheet.AutoFitRows() method, it will suit your needs, see the sample code with output PDF file (attached) by Aspose.Cells APIs:
Sample code:

Workbook wb = new Workbook(strFilePath);
//Autofit rows in the first worksheet to display the wrapping text proper for the header(s).

Let us know if you still have any issue.

Thank you.

This worked, thank you. The lines are acting strangely though. Before version 16, I did not have any issues with thick lines.


Good to know that your issue is sorted out now by the suggested code segment. Regarding thick borders, I think it might be an issue with older version (which is fixed in newer versions) which was not following MS Excel standards/specifications when rendering to PDF file format.

Thank you.