首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

iText学习札记二_基本构建块(basic building blocks)

2012-08-28 
iText学习笔记二_基本构建块(basic building blocks)1.iText基本构建包括Chunk,Phrase,Paragraph,Achor,Li

iText学习笔记二_基本构建块(basic building blocks)

1.iText基本构建包括Chunk,Phrase,Paragraph,Achor,List,ListItem,Chapter,Section,Image,PdfPTable,PdfPCell,ColumnText等

?

2.Document中的add方法的参数是Element,以上那些类都直接或间接的是Elment的扩展。

?

3.Chunks 文本块,

?? Phrases 短语,由一系列Chunk组成

???Paragraph 段落,由一系列Chunk或Phrase组成

?? Achor 超链接(可内链和外链)

???ListItem?Paragraph的一个子类,不可以直接添加到document中,要先加入List中

???PdfPTable 表格组件

?? PdfPCell 单元格组件

?

3.需要注意到是PdfPCell在构建时有两种方式:

1.PdfPCell cell = new PdfPCell(new Paragraph("some text"));

2.PdfPCell cell = new PdfPCell();

cell.addElement(new Paragraph("some text"));

?

第一种称为 Text Mode,paragraph的属性被忽略;

第二种称为Composite Mode,paragraph的属性是有效的。

?

热点排行