added a string value on one of the Headers element and noticed that string won’t wrap text, but will spill over the other 2 elements of the header. The final output is PDF, but tested on .XLSX and same issue.
code eg:
string sNotes = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua";
pageSetup.SetHeader(2, $"{sNotes}");
Attached the output with the issue:
WordWrap issue on header element.zip (122.3 KB)
@Remus87,
This is expected and is not an issue with Aspose.Cells APIs. By default (this is same with MS Excel), long header text won’t be wrapped rather you got to insert line break or new line (e.g., use “\n
” escape char) to manually place new lines feed for your needs. I tested using the following sample code (see the line in bold) and it works fine, the output XLSX and PDF files are Ok:
Workbook workbook = new Workbook(“g:\test2\ValidatSingle.xlsx”);
Worksheet worksheet = workbook.Worksheets[0];
PageSetup pageSetup = worksheet.PageSetup;
string sNotes = “Lorem ipsum dolor sit amet, consectetur\n adipiscing elit, sed do eiusmod tempor\n incididunt ut labore et dolore magna aliqua”;
pageSetup.SetHeader(2, $“{sNotes}”);
workbook.Save(“g:\test2\out11.xlsx”);
workbook.Save(“g:\test2\out12.pdf”);
Hope, this helps a bit.