How retour on line on cell of table pdflib

368 views Asked by At

How I do do retour on line retour chariot on cell of table with pdflib I do that on cell

$tbl = $p->add_table_cell($tbl, $col, $row, $num."\r\n".$quote, $optlist);  

but not do retour on line on cell of table

1

There are 1 answers

0
Rainer On

for a multiline table cell, you have to use a textflow cell. You find a simple sample in the PDFlib cookbook starter_table.php:

    /* ----- Multi-line text with Textflow */
    $col++;
    $font = $p->load_font("Times-Roman", "unicode", "");
    if ($font == 0) {
        die("Error: " . $p->get_errmsg());
    }

    $optlist = "charref fontname=Times-Roman encoding=unicode fontsize=8 ";

    $tf = $p->add_textflow($tf, $tf_text, $optlist);
    if ($tf == 0) {
        die("Error: " . $p->get_errmsg());
    }

    $optlist = "margin=2 textflow=" . $tf;

    $tbl = $p->add_table_cell($tbl, $col, $row, "", $optlist);
    if ($tbl == 0) {
        die("Error: " . $p->get_errmsg());
    }

You fill find a detailed introduction into PDFlib Table and textflow within PDFlib 9 Tutorial, chapter 8.3 and 8.2.