繁体   English   中英

使用正位词将一个单词分为2行

[英]a word is divided into 2 line using aspose words

当我使用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();

有谁知道如何解决这一问题?

谢谢

我使用最新版本的Aspose.Words尝试了您的情况,并且工作正常。 您可以从这里下载并尝试一下。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM