DynaPDF Manual - Page 112

Previous Page 111   Index   Next Page 113

Table Functions
Page 112 of 839
tcGridHorzColor = 2, // Table
-> default black
tcGridVertColor = 3, // Table
-> default black
tcTextColor
= 4
// Table, Columns, Rows, Cells -> default black
}TTableColor;
The function sets or changes the specified color and color space. The number of color components
must match the number of components of the color space. The text color is inherited from the table,
column, and row, in this order. The border color is inherited from columns and rows but not from
the table since the table has its own border.
Extended color spaces will be deleted when the PDF file in memory is closed or when FreePDF() was
called. The color spaces must be recreated when the table should be drawn in another PDF file. Color
space handles may change when recreated in another PDF file. All such colors should be set again to
avoid issues with invalid color space handles.
Width exception of Lab colors, color values are in the range 0 through 1. Lab colors support different
ranges for the L*, a*, and b* components:
L* ->
0 .. 100
a* -> -128 .. 127
b* -> -128 .. 127
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
SetColWidth
Syntax:
LBOOL tblSetColWidth(
const ITBL* Table, // Table pointer
UI32 Col,
// Column index
float Width,
// New width
LBOOL ExtTable)
// Extend the table or adjust the other columns?
The function changes the width of a column. The width of a column can be changed in two different
ways. If the parameter ExtTable is set to true, then the difference of the current and new column
width is added to the table width and the widths of all other columns is left unchanged.
If ExtTable is set to false, the difference is subtracted from the next columns until the gap is zero. If
the width of the column is larger as the table width then the table width is adjusted too. All other
columns get a zero width in this case.
The column widths should be set from lower to higher indexes and no value should be set for the
last column.
No column width should exceed the table width if ExtTable is set to false. Otherwise the widths of all
other columns must be changed again. Change first the table width and then the column widths in
such a case.
 

Previous topic: SetColor, SetColorEx

Next topic: SetFlags