public class Table extends Paragraph implements com.aspose.ms.System.ICloneable, ITextContainer
Represents a table Paragraph
in a Pdf document.
[C#] Pdf pdf1 = new Pdf(); Section sec1 = pdf1.Sections.Add(); Aspose.Pdf.Generator.Table table1 = new Aspose.Pdf.Generator.Table(); sec1.Paragraphs.Add(table1); table1.ColumnWidths = "70 2cm"; Row row1 = table1.Rows.Add(); Cell cell1Row1 = row1.Cells.Add("ColumnsSpan = 2"); cell1Row1.ColumnsSpan = 2; cell1Row1.Border = new BorderInfo((int)BorderSide.All,0.5F); Row row2 = table1.Rows.Add(); Cell cell1Row2 = row2.Cells.Add("cell1"); cell1Row2.Border = new BorderInfo((int)BorderSide.All,0.5F); Cell cell2Row2 = row2.Cells.Add("cell2"); cell2Row2.Border = new BorderInfo((int)BorderSide.All,0.5F,new Aspose.Pdf.Generator.Color("Red")); pdf1.Save(...); [Visual Basic] Dim pdf1 As Pdf = New Pdf() Dim sec1 As Section = pdf1.Sections.Add() Dim table1 As Aspose.Pdf.Generator.Table = New Aspose.Pdf.Generator.Table() sec1.Paragraphs.Add(table1) table1.ColumnWidths = "70 2cm" Dim row1 As Row = table1.Rows.Add() Dim cell1Row1 As Cell = row1.Cells.Add("ColumnsSpan = 2") cell1Row1.ColumnsSpan = 2 cell1Row1.Border = New BorderInfo(CType(BorderSide.All, Integer), 0.5) Dim row2 As Row = table1.Rows.Add() Dim cell1Row2 As Cell = row2.Cells.Add("cell1") cell1Row2.Border = New BorderInfo(CType(BorderSide.All, Integer), 0.5) Dim cell2Row2 As Cell = row2.Cells.Add("cell2") cell2Row2.Border = New BorderInfo(CType(BorderSide.All, Integer), 0.5, New Aspose.Pdf.Generator.Color("Red")) pdf1.Save(...) [XML] <Pdf xmlns="Aspose.Pdf"> <Section> <Table ColumnWidths="70 2cm"> <Row> <Cell ColumnsSpan="2"> <Border> <All LineWidth="0.5"></All> </Border> <Text> <Segment>ColumnsSpan = 2</Segment> </Text> </Cell> </Row> <Row> <Cell> <Border> <All LineWidth="0.5"></All> </Border> <Text> <Segment>cell1</Segment> </Text> </Cell> <Cell> <Border> <All LineWidth="0.5" Color="Red"></All> </Border> <Text> <Segment>cell2</Segment> </Text> </Cell> </Row> </Table> </Section> </Pdf>
Modifier and Type | Class and Description |
---|---|
static class |
Table.tableMatrix |
Paragraph.VerticalPositionInfo
Modifier and Type | Field and Description |
---|---|
com.aspose.ms.System.Collections.Hashtable |
columns
All columns in the table.
|
int |
CornerStyle |
FloatingBox |
FloatingBox
FloatingBox����Ϣ.���������Բ�Ϊ��,˵����table�Ǵ�FloatingBoxת������,��Ҫ����FloatingBox
��Ҫ����ж�λ
|
Text |
formTitle |
boolean |
HasRowSpan |
boolean |
isBorderSetbyUser |
boolean |
IsColIndexProcessed |
boolean |
IsColumnWidthGot |
boolean[] |
IsColumnWidthSetByUser |
boolean |
isDefaultBorderSetbyUser |
boolean |
IsFromCanvas |
boolean |
IsFromFloatingBox
table�Ƿ��floating boxת������
|
boolean |
IsInLine |
boolean |
isUseTOCasTargetList |
boolean |
marginsAlreadyCountedInWidth |
int |
nestedCount |
Table |
refToContainerTable |
Table.tableMatrix[][] |
TableMatrix |
int |
TableMatrixLength |
int |
TableMatrixOffSet |
Cells |
VerticalTextCells |
Paragraphs |
ZIndexParasInTable |
absolutePosX, absolutePosY, ClippingArea, FixedHeight, FixedWidth, isAbsoluteLayout, isFixedLayout, IsNeedAddToPage, IsPositionGot, IsPositionProcessed, isRelativeLayout, MayNeedReprocess, NextParagraph, posBottom, posLeft, posRight, posTop, RefPara, relativePosX, relativePosY, VerticalPosInfo
Constructor and Description |
---|
Table()
Initializes a new instance of the
Table class. |
Table(Cell cell)
Initializes a new instance of the
Table class in the Cell . |
Table(Section section)
Initializes a new instance of the
Table class in the Section . |
Modifier and Type | Method and Description |
---|---|
Object |
completeClone()
Clones a new
Table object. |
Object |
deepClone()
Clones a new
Table object. |
void |
formatColumnsWithFormatInfo(TableFormatInfo info,
int firstColumn,
int maxColumns)
Format the table in specified columns with given TableFormatInfo
|
void |
formatRowsWithFormatInfo(TableFormatInfo info,
int firstRow,
int maxRows)
Format the table in specified rows with given TableFormatInfo
|
void |
formatTableWithFormatInfo(TableFormatInfo info,
int firstColumn,
int firstRow,
int maxRows,
int maxColumns)
Format the table in specified columns and rows with given TableFormatInfo
|
WidthArray |
getAddColWidths() |
WidthArray |
getAddRight() |
int |
getAlignment()
Gets or sets a
AlignmentType that indicates the paragraph alignment type. |
Color |
getBackgroundColor()
Gets or sets a
Aspose.Pdf.Color object that indicates the background color of the table. |
String |
getBackgroundImageFile()
Gets or sets a string that indicates the background image file name.
|
int |
getBackgroundImageType() |
BorderInfo |
getBorder()
Gets or sets a
BorderInfo object that indicates the table border info. |
Text |
getBreakText()
Gets or sets a
Aspose.Pdf.Text object that will appear in the end of the table if it is continued to the next page. |
Cell |
getCell(int row,
int column,
boolean isTableChanged)
Gets a cell according to it's row and column index.
|
int |
getColumnAdjustment()
Gets or sets a
ColumnAdjustmentType that indicates how to determine the width of columns.Default is Customized which means the column width are specified by manual. |
int |
getColumnCount()
Gets or sets an int value that indicates the total column number.
|
String |
getColumnWidths()
Gets or sets a string that contains the width of each columns in this table.
|
WidthArray |
getColWidths()
Gets or sets a
Aspose.Pdf.Xml.WidthArray object that indicates the column width array. |
aspose.pdf.general.composer.ContentComposer |
getComposer() |
BorderInfo |
getDefaultCellBorder()
Gets or sets a
BorderInfo object that indicates the default border style for all cells
in this table. |
MarginInfo |
getDefaultCellPadding()
Gets or sets a
MarginInfo object that indicates the default cell padding in the table. |
TextInfo |
getDefaultCellTextInfo()
Gets or sets a
TextInfo object that indicates the default cell text format info. |
String |
getDefaultColumnWidth()
Get or sets default column width in the table.
|
float |
getFixedWidth()
Gets or sets a float value that indicates the fixed width of the table.
|
float |
getFootNoteHeight() |
float |
getHeight(Pdf doc)
Gets the table height.
|
float |
getMaxColumnWidth(Pdf pdf,
int columnNumber)
Gets the maximum column width which allows text in all cells in the column be shown in one line.
|
float |
getMinColumnWidth(Pdf pdf,
int columnNumber)
Gets the minimum column width at which no hyphenation needs for all cells in the column.
|
Table |
getNextBrokenTable() |
Section |
getParentSection() |
Table |
getParentTable()
Parent table property
|
int |
getRepeatingRows()
Gets or sets a int value that indicates how many rows from the first row will be repeated when
the table is broken across pages.
|
Table |
getRepeatingRowsTable()
Gets or sets a
Table object that contains repeating rows. |
TextInfo |
getRepeatingRowStyle()
Text formatting style for table repeating rows
|
Rows |
getRows()
Gets or sets a
Rows collection that indicates all rows in the table. |
String |
getTitle()
Gets or sets a string value that indicates the title of the table.
|
int |
getVerticalAlignment()
Gets or sets a
VerticalAlignmentType object that indicates the vertical
alignment type of all cells in the table. |
float |
getWidth() |
boolean |
hasEndNote() |
void |
hasEndNote(boolean value) |
boolean |
hasFootNote() |
void |
hasFootNote(boolean value) |
void |
importArray(double[] doubleArray,
int firstRow,
byte firstColumn,
boolean isLeftColumnsFilled)
Imports an array of double number into the table.
|
void |
importArray(int[] intArray,
int firstRow,
byte firstColumn,
boolean isLeftColumnsFilled)
Imports an array of integer into the table.
|
void |
importArray(Object[] objArray,
int firstRow,
byte firstColumn,
boolean isLeftColumnsFilled)
Imports an array of object(any data type) into the table.
|
void |
importArray(String[] stringArray,
int firstRow,
byte firstColumn,
boolean isLeftColumnsFilled)
Imports an array of string into the table.
|
boolean |
isBroaken()
Gets or sets a bool value that indicates whether the table is broken.
|
void |
isBroaken(boolean value) |
boolean |
isBroken()
Gets or sets a bool value that indicates whether the table is allowed to be broken or not when
crossing pages.
|
void |
isBroken(boolean value) |
boolean |
isBrokenTable() |
void |
isBrokenTable(boolean value) |
boolean |
isEmptyRowAtBottomShown()
Gets or sets a bool value that indicates if the empty row at the bottom of the table be shown
in the PDF.
|
void |
isEmptyRowAtBottomShown(boolean value) |
boolean |
isFirstRowRepeated()
Gets or sets a bool value that indicates whether the first row is repeated when its table is broken.
|
void |
isFirstRowRepeated(boolean value) |
boolean |
isFitToPage()
Gets or sets a bool value that indicates whether the table need to be placed on single page.
|
void |
isFitToPage(boolean value) |
boolean |
isFixedRowHeightContentClip()
Gets or sets a value that indicates in case with fixed row height, do content will be truncated if it go out of margin
|
void |
isFixedRowHeightContentClip(boolean value) |
void |
isFixedRowHeightContentOverflow(boolean value) |
boolean |
isGrowInHeightProportionalToAllRaws()
Gets or sets value which says in what way must table grow is MinHeight set:
if set to true - then all rows grew proportionally - if now - only last row grows
|
void |
isGrowInHeightProportionalToAllRaws(boolean value) |
boolean |
isKeptWithNextTable() |
boolean |
isNeedRepeating()
Gets or sets a bool value that indicates whether the paragraph need to be repeated on next page.
|
void |
isNeedRepeating(boolean value) |
boolean |
isOriginalVerticalBrokenTable()
Gets or sets a bool value that indicates whether the table is the original vertical broken table
|
void |
isOriginalVerticalBrokenTable(boolean value) |
boolean |
isRowBroken()
Gets or sets a bool value that indicates whether the row can be broken or not when its table
is broken.
|
void |
isRowBroken(boolean value) |
boolean |
isRowBrokenSetByUser() |
void |
isRowBrokenSetByUser(boolean value) |
boolean |
isSingleHeaderShown()
A bool value that indicates whether table with only a header(IsFirstRowRepeated=true and Rows.Count=1)
be shown.
|
void |
isSingleHeaderShown(boolean value) |
boolean |
isVerticalBroken()
Gets or sets a bool value that indicates whether the table is broken vertically as the table
is printed out of the right page margin.If The sub-table can be place in the same page,it will be placed after the original table in the same page.
|
void |
isVerticalBroken(boolean value) |
boolean |
isVerticalBrokenInSamePage()
Gets or sets a bool value that indicates whether the vertically broken table is in the same page.
|
void |
isVerticalBrokenInSamePage(boolean value) |
boolean |
isWordWrapped()
Gets or sets a boolean value that indicates the alignment type of the cell.
|
void |
isWordWrapped(boolean value) |
void |
setAlignment(int value) |
void |
setBackgroundColor(Color value) |
void |
setBackgroundImageFile(String value) |
void |
setBorder(BorderInfo value) |
void |
setBreakText(Text value) |
void |
setColumnAdjustment(int value) |
void |
setColumnCount(int value) |
void |
setColumnTextInfo(int columnNumber,
TextInfo textInfo)
Sets the text format info of specified column.
|
void |
setColumnWidth(int columnNumber,
float width)
Sets the width of specidied column.
|
void |
setColumnWidths(String value) |
void |
setColWidths(WidthArray value) |
void |
setDefaultCellBorder(BorderInfo value) |
void |
setDefaultCellPadding(MarginInfo value) |
void |
setDefaultCellTextInfo(TextInfo value) |
void |
setDefaultColumnWidth(String value) |
void |
setEndNotePositioning(int value) |
void |
setFixedWidth(float value) |
void |
setFontSizeForTextualChildren(float newFontSize) |
void |
setFootNoteHeight(float value) |
void |
setFromRSItemType(int value) |
void |
setParentHeaderFooter(HeaderFooter value) |
void |
setParentSection(Section value) |
void |
setParentTable(Table value) |
void |
setRepeatingRows(int value) |
void |
setRepeatingRowsTable(Table value) |
void |
setRepeatingRowStyle(TextInfo value) |
void |
setRows(Rows value) |
void |
setTextNameForTextualChildren(String newFontName) |
void |
setTitle(String value) |
void |
setVerticalAlignment(int value) |
copyTo, getBookmarked, getFootNoteProcessed, getHeight, getID, getLeft, getMargin, getNeedReprocess, getNextParagraphInHeading, getPageNumber, getParentCell, getPositioningType, getPosX, getPosY, getRealPageNumber, getReferencedParagraphWidth, getReferenceParagraphID, getRefPageNumber, getSection, getTop, isDisabled, isDisabled, isEndNote, isFirstParagraph, isFirstParagraph, isFirstParagraphInColumn, isFirstParagraphInColumn, isFootNote, isFootNote, isInHeaderFooter, isInHeaderFooter, isInList, isInList, isKeptTogether, isKeptTogether, isKeptWithNext, isKeptWithNext, isOnOddPage, isOnOddPage, setBookmarked, setFootNoteProcessed, setHeight, setID, setLeft, setMargin, setNeedReprocess, setNextParagraphInHeading, setPageNumber, setParentCell, setParentIsTable, setPositioningType, setPosX, setPosY, setRealPageNumber, setReferencedParagraphWidth, setReferenceParagraphID, setRefPageNumber, setSection, setTop, setWidth
public boolean marginsAlreadyCountedInWidth
public boolean isUseTOCasTargetList
public int nestedCount
public Table.tableMatrix[][] TableMatrix
public int TableMatrixOffSet
public int TableMatrixLength
public Paragraphs ZIndexParasInTable
public Table refToContainerTable
public int CornerStyle
public boolean isBorderSetbyUser
public com.aspose.ms.System.Collections.Hashtable columns
All columns in the table.
public boolean isDefaultBorderSetbyUser
public boolean HasRowSpan
public Cells VerticalTextCells
public boolean[] IsColumnWidthSetByUser
public FloatingBox FloatingBox
FloatingBox����Ϣ.���������Բ�Ϊ��,˵����table�Ǵ�FloatingBoxת������,��Ҫ����FloatingBox ��Ҫ����ж�λ
public boolean IsFromFloatingBox
table�Ƿ��floating boxת������
public boolean IsInLine
public boolean IsFromCanvas
public boolean IsColumnWidthGot
public boolean IsColIndexProcessed
public Text formTitle
public Table()
Initializes a new instance of the Table
class.
public Table(Section section)
Initializes a new instance of the Table
class in the Section
.
section
- The section object where the table is in.public Table(Cell cell)
Initializes a new instance of the Table
class in the Cell
.
cell
- The cell object where the table is in.public boolean isFitToPage()
Gets or sets a bool value that indicates whether the table need to be placed on single page. Default value is false.The attribute is only valid when the table is the first paragraph on a page;
public void isFitToPage(boolean value)
public boolean isGrowInHeightProportionalToAllRaws()
Gets or sets value which says in what way must table grow is MinHeight set: if set to true - then all rows grew proportionally - if now - only last row grows
public void isGrowInHeightProportionalToAllRaws(boolean value)
public aspose.pdf.general.composer.ContentComposer getComposer()
getComposer
in class Paragraph
public void setFromRSItemType(int value)
public WidthArray getColWidths()
Gets or sets a Aspose.Pdf.Xml.WidthArray
object that indicates the column width array.
public void setColWidths(WidthArray value)
public boolean isNeedRepeating()
Gets or sets a bool value that indicates whether the paragraph need to be repeated on next page. Default value is false.The attribute is only valid when the paragraph itself and the object its ReferenceParagraphID referred to both are included in RepeatingRows.
public void isNeedRepeating(boolean value)
public boolean isKeptWithNextTable()
public String getColumnWidths()
Gets or sets a string that contains the width of each columns in this table. The value of each column should be separated by blank.The default unit is point, but cm,inch and percentage of available width are also supported.For example,"120 2.5cm 1.5inch", or "60% 40%", The max column number is 1024,
Cell
object needs not set.
public void setColumnWidths(String value)
public float getWidth()
Paragraph
public WidthArray getAddColWidths()
public WidthArray getAddRight()
public boolean hasFootNote()
public void hasFootNote(boolean value)
public float getFootNoteHeight()
public void setFootNoteHeight(float value)
public boolean hasEndNote()
public void hasEndNote(boolean value)
public void setEndNotePositioning(int value)
public boolean isRowBroken()
Gets or sets a bool value that indicates whether the row can be broken or not when its table is broken. Default value is true.
public void isRowBroken(boolean value)
public boolean isRowBrokenSetByUser()
public void isRowBrokenSetByUser(boolean value)
public boolean isBroken()
Gets or sets a bool value that indicates whether the table is allowed to be broken or not when crossing pages.
public void isBroken(boolean value)
public boolean isVerticalBroken()
Gets or sets a bool value that indicates whether the table is broken vertically as the table is printed out of the right page margin.If The sub-table can be place in the same page,it will be placed after the original table in the same page. If The sub-table can't be place in the same page,it will be placed after the original table in the next page. The default value is false.
public void isVerticalBroken(boolean value)
public boolean isOriginalVerticalBrokenTable()
Gets or sets a bool value that indicates whether the table is the original vertical broken table
public void isOriginalVerticalBrokenTable(boolean value)
public boolean isVerticalBrokenInSamePage()
Gets or sets a bool value that indicates whether the vertically broken table is in the same page.
public void isVerticalBrokenInSamePage(boolean value)
public boolean isFirstRowRepeated()
Gets or sets a bool value that indicates whether the first row is repeated when its table is broken.
public void isFirstRowRepeated(boolean value)
public int getRepeatingRows()
Gets or sets a int value that indicates how many rows from the first row will be repeated when the table is broken across pages.
public void setRepeatingRows(int value)
public boolean isFixedRowHeightContentClip()
Gets or sets a value that indicates in case with fixed row height, do content will be truncated if it go out of margin
public void isFixedRowHeightContentClip(boolean value)
public void isFixedRowHeightContentOverflow(boolean value)
public TextInfo getRepeatingRowStyle()
Text formatting style for table repeating rows
public void setRepeatingRowStyle(TextInfo value)
public BorderInfo getBorder()
Gets or sets a BorderInfo
object that indicates the table border info.
public void setBorder(BorderInfo value)
public String getTitle()
Gets or sets a string value that indicates the title of the table.
public void setTitle(String value)
public int getColumnCount()
Gets or sets an int value that indicates the total column number.
public void setColumnCount(int value)
public Rows getRows()
Gets or sets a Rows
collection that indicates all rows in the table.
public void setRows(Rows value)
public Table getRepeatingRowsTable()
Gets or sets a Table
object that contains repeating rows.
public void setRepeatingRowsTable(Table value)
public boolean isBroaken()
Gets or sets a bool value that indicates whether the table is broken.
public void isBroaken(boolean value)
public float getFixedWidth()
Gets or sets a float value that indicates the fixed width of the table.
<BLOCKQUOTE class="dtBlock">
<Font color="red">NOTE: This member is now obsolete.</Font></BLOCKQUOTE>
<BLOCKQUOTE class="dtBlock">
You should use {@code ColumnWidths} to set the column width of the table.
It will be removed 12 months later since release 3.0.0.0 in April 2006. Aspose apologizes for any inconvenience you may have experienced.</BLOCKQUOTE>
public void setFixedWidth(float value)
public int getAlignment()
Gets or sets a AlignmentType
that indicates the paragraph alignment type.
public void setAlignment(int value)
public int getColumnAdjustment()
Gets or sets a ColumnAdjustmentType
that indicates how to determine the width of columns.Default is Customized which means the column width are specified by manual.
public void setColumnAdjustment(int value)
public boolean isBrokenTable()
public void isBrokenTable(boolean value)
public Section getParentSection()
public void setParentSection(Section value)
public Table getParentTable()
Parent table property
public void setParentTable(Table value)
public void setParentHeaderFooter(HeaderFooter value)
public Table getNextBrokenTable()
public BorderInfo getDefaultCellBorder()
Gets or sets a BorderInfo
object that indicates the default border style for all cells
in this table.
public void setDefaultCellBorder(BorderInfo value)
public TextInfo getDefaultCellTextInfo()
Gets or sets a TextInfo
object that indicates the default cell text format info.
public void setDefaultCellTextInfo(TextInfo value)
public int getVerticalAlignment()
Gets or sets a VerticalAlignmentType
object that indicates the vertical
alignment type of all cells in the table.
public void setVerticalAlignment(int value)
public MarginInfo getDefaultCellPadding()
Gets or sets a MarginInfo
object that indicates the default cell padding in the table.
public void setDefaultCellPadding(MarginInfo value)
public String getDefaultColumnWidth()
Get or sets default column width in the table. The default unit is point, but cm and inch are also supported. For example,FitWidth="2cm" or FitWidth="2inch".
public void setDefaultColumnWidth(String value)
public String getBackgroundImageFile()
Gets or sets a string that indicates the background image file name.
public void setBackgroundImageFile(String value)
public int getBackgroundImageType()
public void importArray(String[] stringArray, int firstRow, byte firstColumn, boolean isLeftColumnsFilled)
Imports an array of string into the table.
stringArray
- The string array.firstRow
- The zero oriented row number of the first cell to import in.firstColumn
- The zero oriented column number of the first cell to import in.isLeftColumnsFilled
- If the value of this parameter is true,in the below rows of
the first import row, columns will be filled at the first column of the table. Otherwise,
columns in the below rows will be filled at the first import column specified by the firstColumn
parameter.public void importArray(int[] intArray, int firstRow, byte firstColumn, boolean isLeftColumnsFilled)
Imports an array of integer into the table.
intArray
- The integer array.firstRow
- The zero oriented row number of the first cell to import in.firstColumn
- The zero oriented column number of the first cell to import in.isLeftColumnsFilled
- If the value of this parameter is true,in the below rows of
the first import row, columns will be filled at the first column of the table. Otherwise,
columns in the below rows will be filled at the first import column specified by the firstColumn
parameter.public void importArray(double[] doubleArray, int firstRow, byte firstColumn, boolean isLeftColumnsFilled)
Imports an array of double number into the table.
doubleArray
- The double number array.firstRow
- The zero oriented row number of the first cell to import in.firstColumn
- The zero oriented column number of the first cell to import in.isLeftColumnsFilled
- If the value of this parameter is true,in the below rows of
the first import row, columns will be filled at the first column of the table. Otherwise,
columns in the below rows will be filled at the first import column specified by the firstColumn
parameter.public void importArray(Object[] objArray, int firstRow, byte firstColumn, boolean isLeftColumnsFilled)
Imports an array of object(any data type) into the table.
[C#] Pdf pdf1 = new Pdf(); Section sec1 = pdf1.Sections.Add(); Aspose.Pdf.Generator.Table tab1 = new Aspose.Pdf.Generator.Table(); sec1.Paragraphs.Add(tab1); tab1.ColumnWidths = "60 100 100"; tab1.DefaultCellBorder = new BorderInfo((int)BorderSide.All,0.1F); tab1.DefaultCellTextInfo.Color = new Aspose.Pdf.Generator.Color("Red"); double[] darr = new Double[]{1.5,3.1415926,100000,20,4000,30.4512,45.67}; tab1.ImportArray(darr,1,1,true); Aspose.Pdf.Generator.Table tab2 = new Aspose.Pdf.Generator.Table(); sec1.Paragraphs.Add(tab2); tab2.ColumnWidths = "60 60 60 2cm 100"; tab2.DefaultCellBorder = new BorderInfo((int)BorderSide.All,0.1F); tab2.DefaultCellTextInfo.FontSize = 8; Row row1 = tab2.Rows.Add(); for(int i=1;i<=5;i++) row1.Cells.Add(i.ToString()); for(int j=2;j<5;j++) { row1 = tab2.Rows.Add(); row1.Cells.Add(j.ToString()); } tab2.ImportArray(darr,1,2,false); pdf1.Save(...); [VisualBasic] Dim pdf1 As Pdf = New Pdf("e:\projects\CSharp\customer\Aspose.Pdf.lic") Dim sec1 As Section = pdf1.Sections.Add() Dim tab1 As Aspose.Pdf.Generator.Table = New Aspose.Pdf.Generator.Table() sec1.Paragraphs.Add(tab1) tab1.ColumnWidths = "60 100 100" tab1.DefaultCellBorder = New BorderInfo(CType(BorderSide.All, Integer), 0.1F) tab1.DefaultCellTextInfo.Color = New Aspose.Pdf.Generator.Color("Red") Dim darr() As Double = New Double() {1.5, 3.1415926, 100000, 20, 4000, 30.4512, 45.67} tab1.ImportArray(darr, 1, 1, True) Dim tab2 As Aspose.Pdf.Generator.Table = New Aspose.Pdf.Generator.Table() sec1.Paragraphs.Add(tab2) tab2.ColumnWidths = "60 60 60 2cm 100" tab2.DefaultCellBorder = New BorderInfo(CType(BorderSide.All, Integer), 0.1F) tab2.DefaultCellTextInfo.FontSize = 8 Dim row1 As Row = tab2.Rows.Add() Dim i As Integer For i = 1 To 5 Step i + 1 row1.Cells.Add(i.ToString()) Next Dim j As Integer For j = 2 To 5 - 1 Step j + 1 row1 = tab2.Rows.Add() row1.Cells.Add(j.ToString()) Next tab2.ImportArray(darr, 1, 2, False) pdf1.Save(...)
objArray
- The object array.firstRow
- The zero oriented row number of the first cell to import in.firstColumn
- The zero oriented column number of the first cell to import in.isLeftColumnsFilled
- If the value of this parameter is true,in the below rows of
the first import row, columns will be filled at the first column of the table. Otherwise,
columns in the below rows will be filled at the first import column specified by the firstColumn
parameter.public boolean isSingleHeaderShown()
A bool value that indicates whether table with only a header(IsFirstRowRepeated=true and Rows.Count=1) be shown. The default value is true.
public void isSingleHeaderShown(boolean value)
public Color getBackgroundColor()
Gets or sets a Aspose.Pdf.Color
object that indicates the background color of the table.
public void setBackgroundColor(Color value)
public Text getBreakText()
Gets or sets a Aspose.Pdf.Text
object that will appear in the end of the table if it is continued to the next page.
public void setBreakText(Text value)
public Object deepClone()
Clones a new Table
object. Table properties are cloned but rows in table is not cloned.
deepClone
in interface com.aspose.ms.System.ICloneable
public Object completeClone()
Clones a new Table
object. All members in the table are cloned.
completeClone
in class Paragraph
Table
object.public void setColumnTextInfo(int columnNumber, TextInfo textInfo)
Sets the text format info of specified column.
columnNumber
- The number of the column to be set.textInfo
- The text info object to set.public float getMinColumnWidth(Pdf pdf, int columnNumber)
Gets the minimum column width at which no hyphenation needs for all cells in the column.
Note that you can only use this method to get the minimum width for text paragraphs in the column.
Other paragraph such as image will be ignored.
<BLOCKQUOTE class="dtBlock">
<Font color="red">NOTE: This member is now obsolete.</Font></BLOCKQUOTE>
<BLOCKQUOTE class="dtBlock">
You should use GetMinColumnWidth(Pdf pdf,int columnNumber) which has better performance.
It will be removed 12 months later since release 3.0.0.0 in April 2006. Aspose apologizes for any inconvenience you may have experienced.</BLOCKQUOTE>
Gets the minimum column width at which no hyphenation needs for all cells in the column. Note that you can only use this method to get the minimum width for text paragraphs in the column. Other paragraph such as image will be ignored.
[C#] ... tab1.ImportArray(darr,0,0,true); tab1.SetColumnWidth(2,tab1.GetMinColumnWidth(2)); ... [VisualBasic] tab1.ImportArray(darr,0,0,true) tab1.SetColumnWidth(2,tab1.GetMinColumnWidth(2))
[C#] ... tab1.ImportArray(darr,0,0,true); tab1.SetColumnWidth(2,tab1.GetMinColumnWidth(pdf,2)); ... [VisualBasic] tab1.ImportArray(darr,0,0,true) tab1.SetColumnWidth(2,tab1.GetMinColumnWidth(pdf,2))
columnNumber
- The column number which begins at 0.pdf
- The Pdf
object that indicates the PDF document.columnNumber
- The column number which begins at 0.public float getMaxColumnWidth(Pdf pdf, int columnNumber)
Gets the maximum column width which allows text in all cells in the column be shown in one line.
For example,if the text is "Thank you for considering Aspose",GetMinColumnWidth(Pdf, int)
will return the width of "considering",and this method will return the width of
"Thank you for considering Aspose".
Note that you can only use this method to get the maximum width for text paragraphs in the column.
Other paragraph such as image will be ignored.
[C#] ... tab1.ImportArray(darr,0,0,true); tab1.SetColumnWidth(2,tab1.GetMaxColumnWidth(pdf,2)); ... [VisualBasic] tab1.ImportArray(darr,0,0,true) tab1.SetColumnWidth(2,tab1.GetMaxColumnWidth(pdf,2))
pdf
- The Pdf
object that indicates the PDF document.columnNumber
- The column number which begins at 0.public void setColumnWidth(int columnNumber, float width)
Sets the width of specidied column. This method is used to adjust column width after all cells have
been added to table. Please see example of GetMinColumnWidth(Pdf, int)
.
columnNumber
- The column number which begins at 0.width
- The width to be set.public Cell getCell(int row, int column, boolean isTableChanged)
Gets a cell according to it's row and column index. In the object model of table, rows and cells are represented by collections. When row span or column span is used, it is difficult to get cell from the collections according to it's row and column index. This method is used to get the cell when row span or column span is used.
row
- The 0-based row index.column
- The 0-based column index.isTableChanged
- If the table is changed after the last calling of this method
on the same table.public boolean isEmptyRowAtBottomShown()
Gets or sets a bool value that indicates if the empty row at the bottom of the table be shown in the PDF. When a table is larger and can't be display in one page, the table will be splited into more tables. Sometimes the broken table has a empty row at the bottom. This property is used to control the displaying of the empty row. The default value is false.
public void isEmptyRowAtBottomShown(boolean value)
public float getHeight(Pdf doc)
Gets the table height.
doc
- The Pdf
object.public void formatTableWithFormatInfo(TableFormatInfo info, int firstColumn, int firstRow, int maxRows, int maxColumns)
Format the table in specified columns and rows with given TableFormatInfo
info
- The TableFormatInfo Object.firstColumn
- The first column index.firstRow
- The first Row index.maxRows
- Maximum rows to be imported.maxColumns
- Maximum columns to be imported,no more than 128.public void formatRowsWithFormatInfo(TableFormatInfo info, int firstRow, int maxRows)
Format the table in specified rows with given TableFormatInfo
info
- The TableFormatInfo Object.firstRow
- The first Row index.maxRows
- Maximum rows to be imported.public void formatColumnsWithFormatInfo(TableFormatInfo info, int firstColumn, int maxColumns)
Format the table in specified columns with given TableFormatInfo
info
- The TableFormatInfo Object.firstColumn
- The first column index.maxColumns
- Maximum columns to be imported,no more than 128.public boolean isWordWrapped()
Gets or sets a boolean value that indicates the alignment type of the cell.
public void isWordWrapped(boolean value)
public void setTextNameForTextualChildren(String newFontName)
setTextNameForTextualChildren
in interface ITextContainer
public void setFontSizeForTextualChildren(float newFontSize)
setFontSizeForTextualChildren
in interface ITextContainer
Copyright © 2016 Aspose. All Rights Reserved.