当我使用aspose字来绘制表格时,我发现有时一个单词在表格单元格中分为2行。例如,“组织注册”字符串显示为
组织
名词
注册
在一个单元格中,即“组织”一词分为两行。
但我希望它应该显示为
组织
注册
我的代码是
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.getFont().setName(DEFAULT_FONT);
builder.getFont().setSize(14);
builder.getFont().setBold(true);
builder.getFont().setColor(Color.BLACK);
Table table = builder.startTable();
// Organisation registration
builder.insertCell();
// Table wide formatting must be applied after at least one row is present in the table.
// set borders
table.setBorder(BorderType.TOP, LineStyle.SINGLE, 1.5, Color.BLACK, true);
table.setBorder(BorderType.BOTTOM, LineStyle.SINGLE, 1.5, Color.BLACK, true);
table.setBorder(BorderType.LEFT, LineStyle.NONE, 0, Color.BLACK, true);
table.setBorder(BorderType.RIGHT, LineStyle.NONE, 0, Color.BLACK, true);
table.setBorder(BorderType.HORIZONTAL, LineStyle.NONE, 0, Color.BLACK, true);
table.setBorder(BorderType.VERTICAL, LineStyle.NONE, 0, Color.BLACK, true);
builder.getCellFormat().setVerticalMerge(CellMerge.FIRST);
builder.write("Organisation registration");
builder.insertCell();
builder.getCellFormat().setVerticalMerge(CellMerge.NONE);
builder.write("Legal name");
builder.insertCell();
builder.write(wgeaReportFactModel.getOrgName());
builder.endRow();
有谁知道如何解决这个问题?
感谢