Hi,
I am doing Pdf export by using a excel template file. Please, see the SampleTemplate.xlsx file which is our template and write text in the excel cell(C6).
I have applied following formatting styles in the excel cell.
1. Align text to the top of the cell
2. Align text to the right
3. Wrap Text
when line break into the second line. The second line text alignment not working as expected in pdf. it's align center but it will be right-aligned.
I use these code to export pdf:
Workbook workbook = new Workbook("D:\\SampleTemplate.xlsx");
CellLocator cellLocator = new CellLocator() { SheetName = "Sheet1", Column = 3, Row = 6 };
Aspose.Cells.Cell cell = workbook.Worksheets["Sheet1"].Cells[5, 2];
workbook.Worksheets["Sheet1"].Cells[5, 2].Value = "Patients treated with brand (%)";
byte[] bytes;
using (MemoryStream fileStream = new MemoryStream())
{
workbook.Save(fileStream, SaveFormat.Pdf);
bytes = fileStream.ToArray();
}
string filePath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + @"\saved.pdf";
File.WriteAllBytes(filePath, bytes);
Need help urgently...