28require_once(
'tcpdf_include.php');
 
   38                foreach($lines as $line) {
 
   39                        $data[] = explode(
';', chop($line));
 
   53                $w = array(40, 35, 40, 45);
 
   55                for(
$i = 0; 
$i < $num_headers; ++
$i) {
 
   66                        $this->
Cell(
$w[0], 6, $row[0], 
'LR', 0, 
'L', $fill);
 
   67                        $this->
Cell(
$w[1], 6, $row[1], 
'LR', 0, 
'L', $fill);
 
   68                        $this->
Cell(
$w[2], 6, number_format(
$row[2]), 
'LR', 0, 
'R', $fill);
 
   69                        $this->
Cell(
$w[3], 6, number_format(
$row[3]), 
'LR', 0, 
'R', $fill);
 
   73                $this->
Cell(array_sum(
$w), 0, 
'', 
'T');
 
   82$pdf->SetAuthor(
'Nicola Asuni');
 
   83$pdf->SetTitle(
'TCPDF Example 011');
 
   84$pdf->SetSubject(
'TCPDF Tutorial');
 
   85$pdf->SetKeywords(
'TCPDF, PDF, example, test, guide');
 
  109if (@file_exists(dirname(__FILE__).
'/lang/eng.php')) {
 
  110        require_once(dirname(__FILE__).
'/lang/eng.php');
 
  111        $pdf->setLanguageArray(
$l);
 
  117$pdf->SetFont(
'helvetica', 
'', 12);
 
  123$header = array(
'Country', 
'Capital', 
'Area (sq km)', 
'Pop. (thousands)');
 
  134$pdf->Output(
'example_011.pdf', 
'I');
 
An exception for terminatinating execution or to throw for unit testing.
ColoredTable($header, $data)
PHP class for generating PDF documents without requiring external extensions.
Ln($h='', $cell=false)
Performs a line break.
SetLineWidth($width)
Defines the line width.
Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M')
Prints a cell (rectangular area) with optional borders, background color and character string.
SetDrawColor($col1=0, $col2=-1, $col3=-1, $col4=-1, $ret=false, $name='')
Defines the color used for all drawing operations (lines, rectangles and cell borders).
$w
Current width of page in user unit.
SetTextColor($col1=0, $col2=-1, $col3=-1, $col4=-1, $ret=false, $name='')
Defines the color used for text.
SetFillColor($col1=0, $col2=-1, $col3=-1, $col4=-1, $ret=false, $name='')
Defines the color used for all filling operations (filled rectangles and cell backgrounds).
SetFont($family, $style='', $size=null, $fontfile='', $subset='default', $out=true)
Sets the font used to print character strings.
const PDF_FONT_NAME_MAIN
Default main font name.
const PDF_MARGIN_FOOTER
Footer margin.
const PDF_MARGIN_RIGHT
Right margin.
const PDF_PAGE_FORMAT
Page format.
const PDF_HEADER_STRING
Header description string.
const PDF_HEADER_TITLE
Header title.
const PDF_MARGIN_HEADER
Header margin.
const PDF_CREATOR
Document creator.
const PDF_MARGIN_BOTTOM
Bottom margin.
const PDF_FONT_MONOSPACED
Default monospaced font name.
const PDF_MARGIN_TOP
Top margin.
const PDF_FONT_NAME_DATA
Default data font name.
const PDF_FONT_SIZE_DATA
Default data font size.
const PDF_PAGE_ORIENTATION
Page orientation (P=portrait, L=landscape).
const PDF_UNIT
Document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch].
const PDF_MARGIN_LEFT
Left margin.
const PDF_FONT_SIZE_MAIN
Default main font size.
const PDF_IMAGE_SCALE_RATIO
Ratio used to adjust the conversion of pixels to user units.
const PDF_HEADER_LOGO_WIDTH
Header logo image width in user units.
const PDF_HEADER_LOGO
Deafult image logo used be the default Header() method.