什么是PdfPTable.DefaultCell属性用于? [英] What is the PdfPTable.DefaultCell property used for?
问题描述
什么是 DefaultCell
属性用于什么?
的Pdf文档PdfPTable .getDefaultCell()
读取:
获取默认的 PdfPCell
用作所有 addCell
方法的参考,除了 addCell(PdfPCell)
。
Gets the default PdfPCell
that will be used as reference for all the addCell
methods except addCell(PdfPCell)
.
我不明白。
缺乏.NET库的文档。 Java仍然有文件证明,但不是那么好。我通常从Java中查找,因为这两个API是对称的。但是我仍然不明白这个属性的含义。
The documentation for the .NET library is lacking. The Java one is still documented but again not that well. I usually look up from the Java one because the two API's are symmetrical. But I still don't understand the meaning of this property.
推荐答案
创建 PdfPTable时
When creating a PdfPTable
, you add cells.
一种方法是创建一个 PdfPCell
对象并添加使用 addCell()
方法的单元格。
One way is to create a PdfPCell
object and to add that cell with the addCell()
method.
另一种方法是使用快捷方式:你不是创建一个 PdfPCell
,但你添加一个 String
或一个短语
使用 addCell()
方法到表中。在这种情况下,使用默认属性在内部创建 PdfPCell
。您可以通过更改默认单元格的属性来更改默认属性。使用 getDefaultCell()
方法获取默认单元格。
Another way is to use a short-cut: you don't create a PdfPCell
, but you add a String
or a Phrase
to the table with the addCell()
method. In this case, a PdfPCell
is created internally using default properties. You can change the default properties by changing the properties of the default cell. The default cell is obtained using the getDefaultCell()
method.
这是Javadoc信息的内容:this默认 PdfPCell
将用作所有 addCell()
方法的参考,但 addCell(PdfPCell)除外)
。 (因为在添加 PdfPCell
时,将使用 PdfPCell
的属性,不 默认单元格的属性。)
This is what the Javadoc information is about: this default PdfPCell
will be used as reference for all the addCell()
methods except addCell(PdfPCell)
. (Because when adding a PdfPCell
, the properties of that PdfPCell
will be used, not the properties of the default cell.)
这在我的书iText in Action - Second Edition。
这篇关于什么是PdfPTable.DefaultCell属性用于?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!