2 //============================================================+
3 // File name : tcpdf_config.php
5 // Last Update : 2010-12-16
7 // Description : Alternative configuration file for TCPDF.
9 // Author: Nicola Asuni
15 // 09044 Quartucciu (CA)
19 //============================================================+
22 * Alternative configuration file for TCPDF.
23 * @author Nicola Asuni
24 * @package com.tecnick.tcpdf
29 // DOCUMENT_ROOT fix for IIS Webserver
30 if ((!isset($_SERVER['DOCUMENT_ROOT'])) OR (empty($_SERVER['DOCUMENT_ROOT']))) {
31 if(isset($_SERVER['SCRIPT_FILENAME'])) {
32 $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])));
33 } elseif(isset($_SERVER['PATH_TRANSLATED'])) {
34 $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF'])));
36 // define here your DOCUMENT_ROOT path if the previous fails
37 $_SERVER['DOCUMENT_ROOT'] = '/var/www';
41 // Automatic calculation for the following K_PATH_MAIN constant
42 $k_path_main = str_replace( '\\', '/', realpath(substr(dirname(__FILE__
), 0, 0-strlen('config'))));
43 if (substr($k_path_main, -1) != '/') {
48 * Installation path (/var/www/tcpdf/).
49 * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
51 define ('K_PATH_MAIN', $k_path_main);
53 // Automatic calculation for the following K_PATH_URL constant
54 if (isset($_SERVER['HTTP_HOST']) AND (!empty($_SERVER['HTTP_HOST']))) {
55 if(isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND strtolower($_SERVER['HTTPS'])!='off') {
56 $k_path_url = 'https://';
58 $k_path_url = 'http://';
60 $k_path_url .= $_SERVER['HTTP_HOST'];
61 $k_path_url .= str_replace( '\\', '/', substr(K_PATH_MAIN
, (strlen($_SERVER['DOCUMENT_ROOT']) - 1)));
65 * URL path to tcpdf installation folder (http://localhost/tcpdf/).
66 * By default it is automatically calculated but you can also set it as a fixed string to improve performances..
68 define ('K_PATH_URL', $k_path_url);
72 * use K_PATH_MAIN.'fonts/old/' for old non-UTF8 fonts
74 define ('K_PATH_FONTS', K_PATH_MAIN
.'fonts/');
77 * cache directory for temporary files (full path)
79 define ('K_PATH_CACHE', K_PATH_MAIN
.'cache/');
82 * cache directory for temporary files (url path)
84 define ('K_PATH_URL_CACHE', K_PATH_URL
.'cache/');
89 define ('K_PATH_IMAGES', K_PATH_MAIN
.'images/');
94 define ('K_BLANK_IMAGE', K_PATH_IMAGES
.'_blank.png');
99 define ('PDF_PAGE_FORMAT', 'A4');
102 * page orientation (P=portrait, L=landscape)
104 define ('PDF_PAGE_ORIENTATION', 'P');
109 define ('PDF_CREATOR', 'TCPDF');
114 define ('PDF_AUTHOR', 'TCPDF');
119 define ('PDF_HEADER_TITLE', 'TCPDF Example');
122 * header description string
124 define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
129 define ('PDF_HEADER_LOGO', 'tcpdf_logo.jpg');
132 * header logo image width [mm]
134 define ('PDF_HEADER_LOGO_WIDTH', 30);
137 * document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch]
139 define ('PDF_UNIT', 'mm');
144 define ('PDF_MARGIN_HEADER', 5);
149 define ('PDF_MARGIN_FOOTER', 10);
154 define ('PDF_MARGIN_TOP', 27);
159 define ('PDF_MARGIN_BOTTOM', 25);
164 define ('PDF_MARGIN_LEFT', 15);
169 define ('PDF_MARGIN_RIGHT', 15);
172 * default main font name
174 define ('PDF_FONT_NAME_MAIN', 'helvetica');
177 * default main font size
179 define ('PDF_FONT_SIZE_MAIN', 10);
182 * default data font name
184 define ('PDF_FONT_NAME_DATA', 'helvetica');
187 * default data font size
189 define ('PDF_FONT_SIZE_DATA', 8);
192 * default monospaced font name
194 define ('PDF_FONT_MONOSPACED', 'courier');
197 * ratio used to adjust the conversion of pixels to user units
199 define ('PDF_IMAGE_SCALE_RATIO', 1.25);
202 * magnification factor for titles
204 define('HEAD_MAGNIFICATION', 1.1);
207 * height of cell repect font height
209 define('K_CELL_HEIGHT_RATIO', 1.25);
212 * title magnification respect main font size
214 define('K_TITLE_MAGNIFICATION', 1.3);
217 * reduction factor for small font
219 define('K_SMALL_RATIO', 2/3);
222 * set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language
224 define('K_THAI_TOPCHARS', true);
227 * if true allows to call TCPDF methods using HTML syntax
228 * IMPORTANT: For security reason, disable this feature if you are printing user HTML content.
230 define('K_TCPDF_CALLS_IN_HTML', true);
232 //============================================================+
234 //============================================================+