DsExcel .NET allows users to export Excel files with vertical text to PDF without any issues.
While saving an Excel file with vertical text correctly to a PDF file, the following properties can be used -
Refer to the following example code in order to export Vertical Text to PDF.
C# |
Copy Code |
---|---|
// Create workbook and a worksheet. Workbook workbook = new Workbook(); IWorksheet sheet = workbook.Worksheets[0]; // Specify the font name sheet.Range["A1"].Font.Name = "@Meiryo"; // Set orientation and wrap text sheet.Range["A1"].Orientation = -90; sheet.Range["A1"].WrapText = true; // Set value and configure horizontal and vertical alignment sheet.Range["A1"].Value = "日本列島で使用されてきた言語である。MESCIUS"; sheet.Range["A1"].HorizontalAlignment = HorizontalAlignment.Right; sheet.Range["A1"].VerticalAlignment = VerticalAlignment.Top; // Set column width and row height sheet.Range["A1"].ColumnWidth = 27; sheet.Range["A1"].RowHeight = 190; // Export the worksheet with vertical text ("sheet") to pdf file. sheet.Save(@"D:\sheet.pdf", SaveFileFormat.Pdf); |