在嵌套列表的情况下,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 (将#修改为@)