11 define(
'K_TCPDF_EXTERNAL_CONFIG', 1);
54 define(
'PDF_PAGE_FORMAT',
'A4');
59 define(
'PDF_PAGE_ORIENTATION',
'P');
64 define(
'PDF_CREATOR',
'TCPDF');
69 define(
'PDF_AUTHOR',
'TCPDF');
74 define(
'PDF_HEADER_TITLE',
'TCPDF Example');
79 define(
'PDF_HEADER_STRING',
"by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
84 define(
'PDF_HEADER_LOGO',
'tcpdf_logo.jpg');
89 define(
'PDF_HEADER_LOGO_WIDTH', 30);
94 define(
'PDF_UNIT',
'mm');
99 define(
'PDF_MARGIN_HEADER', 5);
104 define(
'PDF_MARGIN_FOOTER', 10);
109 define(
'PDF_MARGIN_TOP', 27);
114 define(
'PDF_MARGIN_BOTTOM', 25);
119 define(
'PDF_MARGIN_LEFT', 15);
124 define(
'PDF_MARGIN_RIGHT', 15);
129 define(
'PDF_FONT_NAME_MAIN',
'helvetica');
134 define(
'PDF_FONT_SIZE_MAIN', 10);
139 define(
'PDF_FONT_NAME_DATA',
'helvetica');
144 define(
'PDF_FONT_SIZE_DATA', 8);
149 define(
'PDF_FONT_MONOSPACED',
'courier');
154 define(
'PDF_IMAGE_SCALE_RATIO', 1);
159 define(
'HEAD_MAGNIFICATION', 1.1);
164 define(
'K_CELL_HEIGHT_RATIO', 1.25);
169 define(
'K_TITLE_MAGNIFICATION', 1.3);
174 define(
'K_SMALL_RATIO', 2 / 3);
209 public function __construct($orientation =
'P', $unit =
'mm', $format =
'A4', $unicode =
true, $encoding =
'UTF-8', $diskcache =
false)
216 $this->setPrintFooter(
false);
237 public function WriteHTML($html, $ln =
true, $fill =
false, $reseth =
false, $cell =
false, $align =
'')
240 $html = str_replace(
"\n",
' ', $html);
241 $a = preg_split(
'/<(.*)>/U', $html, -1, PREG_SPLIT_DELIM_CAPTURE);
242 foreach ($a as $i => $e) {
246 $this->
PutLink($this->HREF, $e);
253 $this->
CloseTag(strtoupper(substr($e, 1)));
256 $a2 = explode(
' ', $e);
257 $tag = strtoupper(array_shift($a2));
259 foreach ($a2 as $v) {
260 if (preg_match(
'/^([^=]*)=["\']?([^"\']*)["\']?$/', $v, $a3)) {
261 $attr[strtoupper($a3[1])] = $a3[2];
278 if ($tag ==
'B' or $tag ==
'I' or $tag ==
'U') {
283 $this->HREF = (is_array($attr) && isset($attr[
'HREF'])) ? $attr[
'HREF'] :
'';
298 if ($tag ==
'B' or $tag ==
'I' or $tag ==
'U') {
315 $this->$tag += ($enable ? 1 : -1);
317 foreach (array(
'B',
'I',
'U') as $s) {
333 $this->SetTextColor(0, 0, 255);
335 $this->Write(5, $sText, $sURL);
337 $this->SetTextColor(0);
350 public function SetFont($family, $style =
'', $size = 0, $fontfile =
'')
352 if ($family ==
'Arial') {