/* Note that the 4th column is a barcode column; the header should have the text "Barcode" in it, so it's a instance of jh_pdf_text_jhpci just like the other columns; however, the rows should show a barcode; this is done by just using another class, the rest is the same as with the other columns! */ $col4h = new jh_pdf_text_jhpci(&$pdf); $col4r = new jh_pdf_container_jhpci(&$pdf); $col4r->addobject($barcode); $col4r->addemptyspace(3); $col4r->addobject($bctext); /* Use Courier for the rows in the 2nd and 3rd column and make the content right-aligned */ $col2r->setfontface("Courier"); $col2r->setalignment("right"); $col2h->setalignment("right"); $col3r->setfontface("Courier"); $col3r->setalignment("right"); $col3h->setalignment("right"); /* Make an instance of the table class */ $table = new jh_pdf_table(&$pdf, &$ypos, 30, 812, 30); /* Set a function that will be called if a new page is necessary */ $table->setnewpagefunction(newpage); /* Define the columns; the first column has "*" as its width which tells the class to use the remaining width for this column; the addcolumn() method returns a handle so you can adjust the column's parameters */ $col1 =& $table->addcolumn("License", "*", &$col1h, &$col1r); $col2 =& $table->addcolumn("Branches", 100, &$col2h, &$col2r); $col3 =& $table->addcolumn("Percentage", 100, &$col3h, &$col3r); $col4 =& $table->addcolumn("Barcode", 100, &$col4h, &$col4r); /* Adjust some table parameters */