[]
Workbook. Use this class to configure workbook-level behaviors at construction time, such as whether column widths are measured in pixels instead of character counts. Enabling pixel-based column width can make API behaviors such as auto-fit column, and rendering results such as PDF and image output, closer to SpreadJS.
WorkbookOptions options = new WorkbookOptions();
options.setPixelBasedColumnWidth(true);
Workbook workbook = new Workbook(options);
IWorksheet worksheet = workbook.getWorksheets().get(0);
worksheet.getRange("A:A").setColumnWidthInPixel(96);
double widthInPixels = worksheet.getRange("A:A").getColumnWidthInPixel();
booleanvoidsetPixelBasedColumnWidth(boolean value) By default, a workbook uses character count based column width. Set this option to true to use pixels as the column width unit so that API behaviors such as auto-fit columns and rendering results such as PDF and image output are closer to SpreadJS.
WorkbookOptions options = new WorkbookOptions();
options.setPixelBasedColumnWidth(true);
boolean pixelBased = options.getPixelBasedColumnWidth();
Workbook workbook = new Workbook(options);
true if the workbook uses pixel-based column width; otherwise, false. The default value is false.By default, a workbook uses character count based column width. Set this option to true to use pixels as the column width unit so that API behaviors such as auto-fit columns and rendering results such as PDF and image output are closer to SpreadJS.
WorkbookOptions options = new WorkbookOptions();
options.setPixelBasedColumnWidth(true);
Workbook workbook = new Workbook(options);
IWorksheet worksheet = workbook.getWorksheets().get(0);
worksheet.getRange("A:A").setColumnWidthInPixel(96);
value - true if the workbook uses pixel-based column width; otherwise, false. The default value is false.