function pageheader() { if ($this->title != '') { // Table for titles switch ($this->orientation) { case LANDSCAPE: $atable = new jh_pdf_table(&$this->pdf, &$this->ypos, $this->subx, 812, 30); break; case PORTRAIT: $atable = new jh_pdf_table(&$this->pdf, &$this->ypos, $this->subx, 565, 30); break; } //****************************************************** $fecha = date("d/m/Y h:m:s"); $colh = new jh_pdf_text_jhpci(&$this->pdf); $colh->setfontsize(26); $colr = new jh_pdf_text_jhpci(&$this->pdf); $colr->setfontsize($this->pdffontsize); $tcol =& $atable->addcolumn($this->title, '*', $colh, $colr); $colh = new jh_pdf_text_jhpci(&$this->pdf); $colh->setalignment("right"); $colh->setfontsize($this->pdffontsize); $colr = new jh_pdf_text_jhpci(&$this->pdf); $colr->setfontsize($this->pdffontsize); $dcol =& $atable->addcolumn($fecha . "", '*', $colh, $colr); $this->phpgrid->getlookupquery(); $what = $this->phpgrid->statustext; if ($what == '') { $what = 'Mostrando todos los registros'; } $data = array($what); $atable->addrow($data); $atable->endtable(); } }
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 */ $table->setverttableborderwidth(1); $table->setverttablebordercolor(0); $table->setcolspacingwidth(1); $table->setcolspacingcolor(0);
$barcode->settype('25i'); $barcode->setheight(20); /* Create a text object which will contain the same number as the barcode, but this time as plain text */ $bctext = new jh_pdf_text_jhpci(&$pdf); $bctext->setalignment("center"); /* Create a container object and put in the three objects created above and some empty space between them */ $content = new jh_pdf_container_jhpci(&$pdf); $content->addobject($day); $content->addemptyspace(3); $content->addobject($barcode); $content->addemptyspace(3); $content->addobject($bctext); /* Make an instance of the table class */ $table = new jh_pdf_table(&$pdf, &$ypos, 30, 565, 30); /* Set a function that will be called if a new page is necessary */ $table->setnewpagefunction(newpage); /* Define the columns; note that all the columns have "*" as their width which means that the whole table width will be divided up and assigned equally to the columns */ $col1 =& $table->addcolumn("", "*", false, $content); $col2 =& $table->addcolumn("", "*", false, $content); $col3 =& $table->addcolumn("", "*", false, $content); $col4 =& $table->addcolumn("", "*", false, $content); /* Adjust some table parameters */ $table->settopborderwidth(0); $table->setbottomborderwidth(0); $table->setcolspacingwidth(50); $table->setcolspacingcolor(false); $table->setrowspacingwidth(10);
the barcode, but this time as plain text */ $bctext = new jh_pdf_text_jhpci(&$pdf); $bctext->setalignment("center"); /* Create a text object which will contain the article name */ $article = new jh_pdf_text_jhpci(&$pdf); $article->setalignment("center"); /* Create a container object and put in the three objects created above and some empty space between them */ $content = new jh_pdf_container_jhpci(&$pdf); $content->addobject($barcode); $content->addemptyspace(3); $content->addobject($bctext); $content->addemptyspace(3); $content->addobject($article); /* Make an instance of the table class */ $table = new jh_pdf_table(&$pdf, &$ypos, 3, 592, 25.5); /* Set a function that will be called if a new page is necessary */ $table->setnewpagefunction(newpage); /* Make the row height static; this is useful for labels Bill, is this what you want? ;-) */ $table->forcerowheight(71.90000000000001); /* Hide table contents exceeding the table boundaries */ $table->cliptocell(); /* Define the columns; note that all the columns have "*" as their width which means that the whole table width will be divided up and assigned equally to the columns */ $col1 =& $table->addcolumn("", "*", false, $content); $col1->normcellparam->leftpadding = 25; $col1->normcellparam->rightpadding = 25; $col1->normcellparam->toppadding = 10; $col1->normcellparam->bottompadding = 0;