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