【问题标题】:itext 7.1.2 percent table widthitext 7.1.2% 表格宽度
【发布时间】:2018-08-08 19:15:50
【问题描述】:

有一个 iText 7.0.7 的表格方法有效:

Table table = new Table(new float [] {4,1,3,4,3,3,3,3,1});
table.setWidthPercent(100);

但在 iText 7.1.2 中找不到此方法:

table.setWidthPercent(100);

请他们知道新方法是什么或它已经转移到哪里了。

【问题讨论】:

    标签: java itext7


    【解决方案1】:

    请尝试

    table.setWidth(UnitValue.createPercentValue(100)):
    

    在 iText 7.1.x 中,许多维度属性已被概括为包含一个 UnitValue 实例,该实例可以是绝对的(以点为单位)或相对的(以百分比为单位)。

    【讨论】:

    • 谢谢!再查询一下,7.1.2这个版本中不存在Color类你知道他搬到哪里了,或者我在哪里找到更多信息。导入com.itextpdf.kernel.color.Color;导入 com.itextpdf.kernel.color.DeviceCmyk;
    • 大约一年过去了,包com.itextpdf.kernel.color 已重命名为com.itextpdf.kernel.colors
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-17
    • 1970-01-01
    • 2013-04-26
    • 1970-01-01
    • 2011-08-20
    相关资源
    最近更新 更多