- Document Solutions for Excel, Java Edition Overview
- Key Features
- Getting Started
- Features
- Templates
-
File Operations
- Import and Export .xlsx Document
-
Export to PDF
- Configure Fonts and Set Style
- Customize Border Style
- Export Pivot Table Styles And Format
- Export Shapes
- Export Borders
- Export Conditional Formatting
- Control Pagination
- Export Fills
- Export Picture
- Export Charts
- Export Sparkline
- Export Table
- Export Text
- Export Vertical Text
- Shrink To Fit With Text Wrap
- Export Slicers
- Export Barcodes
- Export Signature Lines
- Export Form Controls to Form Fields
- Support Security Options
- Support Document Properties
- Adjust Column Width and Row Height
- Support Sheet Background Image
- Support Background Color Transparency
- Track Export Progress
- Export to HTML
- Working With Page Setup
- Import and Export CSV File
- Import CSV File with Custom Parser
- Import and Export CSV Files with Delimiters
- Import and Export SpreadJS Files
- Import and Export Macros
- Import and Export Excel Templates
- Import and Export OLE Objects
- Convert to Image
- Import and Export Excel Options
- Use JDK 8 Date Time API
- Document Solutions Data Viewer
- API Reference
- Release Notes
(Showing Draft Content)
Export Vertical Text
DsExcel Java 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 -
- IRange.Orientation - The setOrientation() method of the IRange interface sets the orientation of the text.
- IRange.Font.Name - Sets the specific font name using the getFont method of the IRange interface. If the font name starts with "@", each double-byte character in the text is rotated to 90 degrees.
Refer to the following example code in order to export vertical text to PDF.
// Initialize workbook
Workbook workbook = new Workbook();
// Fetch default worksheet
IWorksheet worksheet = workbook.getWorksheets().get(0);
// Fetch the cell range A1
IRange a1 = worksheet.getRange("A1");
// Setting Cell A1 Text
a1.setValue("This is a vertical text");
// Formatting A1 cell
a1.getFont().setName("Verdana");
a1.setHorizontalAlignment(HorizontalAlignment.Right);
a1.setVerticalAlignment(VerticalAlignment.Top);
a1.setOrientation(90);
a1.setWrapText(true);
a1.setColumnWidth(27);
a1.setRowHeight(190);
// Saving workbook to PDF
workbook.save("6- ExportVerticalTextToPDF.pdf", SaveFileFormat.Pdf);
type=note
Note: The following limitations must be kept in mind while exporting Excel files with vertical text to PDF -
- The orientation can only be set to 0, 90, -90 and 255. Other values will be treated as 0 while rendering the PDF file.
- If the font name starts with "@" and the orientation is 255, DsExcel will ignore the "@".