1
創建內iTextSharp的嵌套列表是簡單iTextSharp的 - )名單中的多個級別(
var list = new List(true);
list.add("Something here");
list.add("Something else here");
var nestedList = new List(true);
nestedList.add("Some other value");
list.add(nestedList);
document.add(list); // assuming here of course you have
// created an instance of Document()!
會產生非常基本的,如
- 的東西在這裏
- 別的東西在這裏
-
東西
- 其他值
我想創造一些更復雜的東西;我創建其中有條款和分條款的文件,以便要列出每個列表項是這樣的:
1. Parent list item
1.1 Something here
1.2 Something else here
,但我不能在任何地方看到的API,其中這是可能的範圍內。我認爲這樣做的唯一方法是使用Paragraph()
,但是有其他人會遇到更優雅的解決方案嗎?
感謝
對不起,這不是我想要的。我知道如何嵌套列表,但我想具體有1.1和1.2。我會更新我的問題以反映這一點。 – Matt
@Matt我已更新我的問題,以顯示我知道的唯一方法。如果這不好,請讓我知道,我會刪除它,因爲downvote從我的聲譽中脫穎而出。似乎沒有辦法從api中確定父級,除非我錯過了它:http://api.itextpdf.com/itext/com/itextpdf/text/List.html – hutchonoid
@hutchoniod這是正是我想要的。非常感謝你! – Matt