PDFLIB :add_table_cell:No more table cells can be added (table fitting has started)

589 views Asked by At

I have this error:

PDFLIB :add_table_cell:No more table cells can be added (table fitting has started)

When I want create table contains the title statique and the content dynamic

Example of code :

$tbl = $p->add_table_cell($tbl, 6, $row, 
        $deliveryinfo->Contact.'-'.$deliveryinfo->ExpectedQuantity, $optqteprévue);
if ($tbl == 0)

    throw new Exception("Error: " . $p->get_errmsg());


$row++;

$optlist = "stroke={{line=frame linewidth=0.8} " .
        "{line=other linewidth=0.3}}";

$result = $p->fit_table($tbl, 19, 220, 497, 120, $optlist);
1

There are 1 answers

0
Rainer On

I guess the error message explain the reason in detail and should be simple to fix. Also, what you might have read before in the PDFlib 9 Tutorial, chapter 8.3, but do not have longer in mind:

Creating a table starts by defining the contents and visual properties of each table cell with PDF_add_table_cell( ). Then you place the table using one or more calls to PDF_fit_table( ).

=> you have to build first the complete table by multiple add_table_cell() calls, and after you have added all cells you fit the content in a second step. You need sample code? Please check the samples within the PDFlib Cookbook, like the starter_table.php sample