Ejemplo n.º 1
0
// end of extended class
// ---------------------------------------------------------
// EXAMPLE
// ---------------------------------------------------------
// create new PDF document
$pdf = new MC_TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator("Laurentiu Trica");
$pdf->SetAuthor('Laurentiu Trica');
$pdf->SetTitle('Etichete Proiect 21.000');
$pdf->SetSubject('Etichete Proiect 21.000');
//set margins
$pdf->SetMargins(8, 2, 3, true);
$pdf->SetHeaderMargin(false);
$pdf->SetFooterMargin(false);
$pdf->setPrintHeader(false);
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, 0);
$result = getBiblioteciFinal();
$text = "";
$i = 0;
while ($row = mysql_fetch_assoc($result)) {
    $i++;
    $spaces1 = 200;
    $spaces = 175;
    $nume_spaces = ($spaces1 - strlen($row["nume"])) * 6;
    $nume_spaces_2 = ($nume_spaces - strlen($row["nume"])) % 6;
    $nume_spaces = $nume_spaces - $nume_spaces_2;
    $nume = str_pad($row["nume"], $nume_spaces, " ");
    $adresa_spaces = ($spaces - strlen($row["adresa"])) * 6;
    $adresa_spaces_2 = ($adresa_spaces - strlen($row["adresa"])) % 6;