微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在嵌套列表的情况下,itext 7 是否支持列表样式位置 CSS?

如何解决在嵌套列表的情况下,itext 7 是否支持列表样式位置 CSS?

Document document = new Document(pdf);

    List parentList = new List(ListNumberingType.DECIMAL_LEADING_ZERO);
    ListItem listItem = new ListItem("ListItem 1");
    parentList.setProperty(Property.LIST_SYMBOL_POSITION,ListSymbolPosition.INSIDE);

    List nestedList = new List(ListNumberingType.ROMAN_LOWER);
    ListItem nestedListItem =  new ListItem("ListItem 1.1");
    nestedList.setProperty(Property.LIST_SYMBOL_POSITION,ListSymbolPosition.DEFAULT);

    nestedList.add(nestedListItem);
    listItem.add(nestedList);
    ListItem listItem2 = new ListItem("ListItem 2");

    parentList.add(listItem);
    parentList.add(listItem2);
    document.add(parentList);

在上述情况下,当设置 LIST_SYMBOL_POSITION 属性时,嵌套的子级将呈现为父级的兄弟。

实际输出

Actual Output

预期输出

enter image description here

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。