Project

General

Profile

Defect #1708 » ex1.php

Andrei Bintintan, 12/30/2018 09:50 PM

 
1
<?php
2
/**
3
 * Pdf Advanced Table - Example
4
 * Copyright (c), Interpid, http://www.interpid.eu
5
 */
6

    
7
require_once __DIR__ . "/../autoload.php";
8

    
9
use Interpid\PdfLib\Table;
10

    
11
//get the PDF object
12
$pdf = new \Interpid\PdfLib\Pdf();
13
// use the default TCPDF configuration
14
$pdf->SetFont( 'helvetica', '', 11 );
15

    
16
// add a page
17
$pdf->AddPage();
18
/**
19
 * Create the pdf Table object
20
 * Alternative you can use the Singleton Instance
21
 *
22
 * @example : $table = Table::getInstance($pdf);
23
 */
24
$table = new Table( $pdf );
25

    
26

    
27
$table->initialize( [30,30,30] );
28
    $table->addRow(array(
29
        [ 'TEXT' => 'ì' ],
30
        [ 'TEXT' => date("d/m/Y H:i") ],
31
        [ 'TEXT' => '€123' ],
32
    ));
33

    
34
$table->close();
35

    
36
//send the pdf to the browser
37
$pdf->Output();
(1-1/3)