/
test3.php
executable file
·130 lines (104 loc) · 2.45 KB
/
test3.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?php
require('inc/fpdf.php');
define('FPDF_FONTPATH','font/');
class PDF extends FPDF
{
//Page header
function Header()
{
/*
//Logo
$this->Image('../rootbg2.jpg',10,8,33);
//Arial bold 15
$this->SetFont('Arial','B',15);
//Move to the right
$this->Cell(80);
//Title
$this->Cell(60,10,'to je vedno zgoraj.... ',1,0,'C');
//Line break
$this->Ln(20);
*/
}
//Page footer
function Footer()
{
/*
//Position at 1.5 cm from bottom
$this->SetY(-15);
//Arial italic 8
$this->SetFont('Arial','I',8);
//Page number
$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
*/
}
}
/**
* spacer function
*
* adds spaces to the letters
*
*/
function spacer($text,$number = 5) {
if ($text) {
//set up spacer//
for ($i = 0; $i < $number; $i++)
{
$spacer.=" ";
}
//spacer smaller//
$len_space = strlen($spacer);
$spacer_small = substr ( $spacer , 0, $len_space - 1 );
$len = strlen($text);
//add spaces to the text//
$x=0;
for ($i = 0; $i < $len ; $i++)
{
$out .= $text[$i];
if ($x == 5 ) {
$out .= $spacer_small;
$x=0;
} else
$out .= $spacer;
$x++;
}
//return modified text//
return $out;
} else return false;
}
$SUMNIKI = "ŠČŽščž";
//$text = iconv("UTF-8//TRANSLIT", "iso-8859-2", $SUMNIKI);
//
//
//$text = iconv("iso-8859-1", "iso-8859-2", $SUMNIKI);
$s="čšžčk";
//$s is a string from whatever source
//mb_detect_encoding($s, "UTF-8") == "UTF-8" ? : $s = utf8_encode($s);
//$s = iconv("UTF-8//TRANSLIT", "iso-8859-2", $s);
utf8_encode($s);
///koliko bomo pomaknili vse v desno//
$XOF = 26;
$LN_DEFAULT = 4;
//Instanciation of inherited class
$pdf=new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();
//$pdf->AddFont('luxisb','','luxisb.php');
$pdf->AddFont('Arial','','Arial.php');
$pdf->SetFont('Arial','',8);
//Cell(float w [, float h [, string txt [, mixed border [, int ln [, string align [, boolean fill [, mixed link]]]]]]])
//NAziv in sedez
$pdf->SetXY($XOF+35, 29);
$pdf->Cell(0,0,"Root d.o.o., cesta v $s 10 3320 velenje",0,0,'L');
//$pdf->MultiCell(65, 4,'sss', '', 'TL',0);
$pdf->Ln($LN_DEFAULT);
$pdf->SetXY($XOF+22, $pdf->getY());
//napisemo davcno//
$pdf->Cell(0,0,spacer("2005977500396",4),0,0,'L');
//nova vrsta
$pdf->Ln($LN_DEFAULT);
$pdf->SetXY($XOF+30, $pdf->getY());
//gospodarska dejavnost//
$pdf->Cell(0,0,'Struzenje in gledanje',0,0,'L');
//output of the PDF//
$pdf->Output("test.pdf","I");
?>