root / evote / costastest / tfpdf / ex.php @ f52a1778
History | View | Annotate | Download (717 Bytes)
1 |
<?php
|
---|---|
2 |
|
3 |
// Optionally define the filesystem path to your system fonts
|
4 |
// otherwise tFPDF will use [path to tFPDF]/font/unifont/ directory
|
5 |
// define("_SYSTEM_TTFONTS", "C:/Windows/Fonts/");
|
6 |
|
7 |
require('tfpdf.php'); |
8 |
|
9 |
$pdf = new tFPDF(); |
10 |
$pdf->AddPage(); |
11 |
|
12 |
// Add a Unicode font (uses UTF-8)
|
13 |
$pdf->AddFont('DejaVu','','DejaVuSansCondensed.ttf',true); |
14 |
$pdf->SetFont('DejaVu','',14); |
15 |
|
16 |
// Load a UTF-8 string from a file and print it
|
17 |
$txt = file_get_contents('HelloWorld.txt'); |
18 |
$pdf->Write(8,"???? ??? ??????!"); |
19 |
$pdf->Ln(10); |
20 |
$pdf->Write(8,"???? bla ????"); |
21 |
$pdf->Ln(10); |
22 |
$pdf->Write(8,$txt); |
23 |
|
24 |
|
25 |
// Select a standard font (uses windows-1252)
|
26 |
$pdf->SetFont('Arial','',14); |
27 |
$pdf->Ln(10); |
28 |
|
29 |
$pdf->Output(); |
30 |
?>
|