<?php // Optionally define the filesystem path to your system fonts // otherwise tFPDF will use [path to tFPDF]/font/unifont/ directory // define("_SYSTEM_TTFONTS", "C:/Windows/Fonts/"); require 'tfpdf.php'; $pdf = new tFPDF(); $pdf->AddPage(); // Add a Unicode font (uses UTF-8) $pdf->AddFont('DejaVu', '', 'DejaVuSansCondensed.ttf', true); $pdf->SetFont('DejaVu', '', 14); // Load a UTF-8 string from a file and print it $txt = file_get_contents('HelloWorld.txt'); $pdf->Write(8, $txt); // Select a standard font (uses windows-1252) $pdf->SetFont('Arial', '', 14); $pdf->Ln(10); $pdf->Write(5, 'The file size of this PDF is only 12 KB.'); $pdf->Output();
<?php // Définition facultative du répertoire des polices systèmes // Sinon tFPDF utilise le répertoire [chemin vers tFPDF]/font/unifont/ // define("_SYSTEM_TTFONTS", "C:/Windows/Fonts/"); require 'tfpdf.php'; $pdf = new tFPDF(); $pdf->AddPage(); // Ajoute une police Unicode (utilise UTF-8) $pdf->AddFont('DejaVu', '', 'DejaVuSansCondensed.ttf', true); $pdf->SetFont('DejaVu', '', 14); // Charge une chaîne UTF-8 à partir d'un fichier $txt = file_get_contents('HelloWorld.txt'); $pdf->Write(8, $txt); // Sélectionne une police standard (utilise windows-1252) $pdf->SetFont('Arial', '', 14); $pdf->Ln(10); $pdf->Write(5, "La taille de ce PDF n'est que de 12 ko."); $pdf->Output();
$stmt = $recupform->runQuery("SELECT id FROM questions ORDER BY id DESC LIMIT 1"); $stmt->execute(); $liste = $stmt->fetch(); $idmax = $liste[0]; extract($_POST); $answerClasse = $_POST["secteur"]; $stmt = $recupform->runQuery("SELECT question FROM questions WHERE id = 1"); $stmt->execute(); $liste = $stmt->fetch(); $question = $liste[0]; $stmt2 = $recupform->runQuery("SELECT reponse FROM answers WHERE id={$answerClasse}"); $stmt2->execute(); $liste2 = $stmt2->fetch(); $reponse = $liste2[0]; $pdf->SetPoliceQuestion(); $pdf->Write(5, $question); $pdf->Ln(); $pdf->SetPoliceReponse(); $pdf->Cell('25'); //recup reponse et affiché $pdf->Write(5, $reponse); $pdf->Ln(20); if ($_POST['secteur'] == 1) { $classScore = 1; } elseif ($_POST['secteur'] == 2) { $classScore = 2; } else { $classScore = 3; } for ($i = 1; $i < $idmax + 1; $i++) { $answerI = "answers" . $i;
IF(!isset($CERTIFICATES)) { if (substr($_SERVER["REQUEST_URI"],0,6)=="/beta/") require_once "../".DIR_FPDF; else require_once DIR_FPDF; $pdf = new tFPDF(); $pdf->SetAutoPageBreak(true,10); $pdf->AddFont('DejaVu','','DejaVuSans.ttf',true); $pdf->AddFont('DejaVu','B','DejaVuSans-Bold.ttf',true); $pdf->AddPage(); $pdf->SetFont('DejaVu','B',16); $pdf->Write(5,$_SESSION["c_name"]); $pdf->Ln(); $pdf->SetFont('','',14); $pdf->Write(5,"Podiums"); $pdf->Line(11,21,286.5,21); $pdf->Ln(10); } $events = strict_query("SELECT $eventstable.*, name, timetype FROM $eventstable JOIN categories ON categories.id=$eventstable.id ORDER BY $eventstable.id"); while ($rowEvt=cased_mysql_fetch_array($events)) { $round = 4; while ($round > 1 && !$rowEvt["r".$round."_open"]) $round--; $format = strict_query("SELECT name, avgtype FROM formats WHERE id=".$rowEvt["r".$round."_format"]); $avgname = cased_mysql_result($format,0,"name"); $avgtype = cased_mysql_result($format,0,"avgtype");