2 //============================================================+
3 // File name : tcpdf_config.php
5 // Last Update : 2011-04-15
7 // Description : Configuration file for TCPDF.
8 // Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - info@tecnick.com
9 // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
10 // -------------------------------------------------------------------
11 // Copyright (C) 2004-2012 Nicola Asuni - Tecnick.com LTD
13 // This file is part of TCPDF software library.
15 // TCPDF is free software: you can redistribute it and/or modify it
16 // under the terms of the GNU Lesser General Public License as
17 // published by the Free Software Foundation, either version 3 of the
18 // License, or (at your option) any later version.
20 // TCPDF is distributed in the hope that it will be useful, but
21 // WITHOUT ANY WARRANTY; without even the implied warranty of
22 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23 // See the GNU Lesser General Public License for more details.
25 // You should have received a copy of the GNU Lesser General Public License
26 // along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
28 // See LICENSE.TXT file for more information.
29 //============================================================+
32 * Configuration file for TCPDF.
33 * @author Nicola Asuni
34 * @package com.tecnick.tcpdf
39 // If you define the constant K_TCPDF_EXTERNAL_CONFIG, the following settings will be ignored.
41 if (!defined('K_TCPDF_EXTERNAL_CONFIG')) {
43 // DOCUMENT_ROOT fix for IIS Webserver
44 if ((!isset($_SERVER['DOCUMENT_ROOT'])) OR (empty($_SERVER['DOCUMENT_ROOT']))) {
45 if(isset($_SERVER['SCRIPT_FILENAME'])) {
46 $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])));
47 } elseif(isset($_SERVER['PATH_TRANSLATED'])) {
48 $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF'])));
50 // define here your DOCUMENT_ROOT path if the previous fails (e.g. '/var/www')
51 $_SERVER['DOCUMENT_ROOT'] = '/';
55 // Automatic calculation for the following K_PATH_MAIN constant
56 $k_path_main = str_replace( '\\', '/', realpath(substr(dirname(__FILE__), 0, 0-strlen('config'))));
57 if (substr($k_path_main, -1) != '/') {
62 * Installation path (/var/www/tcpdf/).
63 * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
65 define ('K_PATH_MAIN', $k_path_main);
67 // Automatic calculation for the following K_PATH_URL constant
68 $k_path_url = $k_path_main; // default value for console mode
69 if (isset($_SERVER['HTTP_HOST']) AND (!empty($_SERVER['HTTP_HOST']))) {
70 if(isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND strtolower($_SERVER['HTTPS'])!='off') {
71 $k_path_url = 'https://';
73 $k_path_url = 'http://';
75 $k_path_url .= $_SERVER['HTTP_HOST'];
76 $k_path_url .= str_replace( '\\', '/', substr(K_PATH_MAIN, (strlen($_SERVER['DOCUMENT_ROOT']) - 1)));
80 * URL path to tcpdf installation folder (http://localhost/tcpdf/).
81 * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
83 define ('K_PATH_URL', $k_path_url);
87 * use K_PATH_MAIN.'fonts/old/' for old non-UTF8 fonts
89 define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/');
92 * cache directory for temporary files (full path)
94 define ('K_PATH_CACHE', K_PATH_MAIN.'cache/');
97 * cache directory for temporary files (url path)
99 define ('K_PATH_URL_CACHE', K_PATH_URL.'cache/');
104 define ('K_PATH_IMAGES', K_PATH_MAIN.'images/');
109 define ('K_BLANK_IMAGE', K_PATH_IMAGES.'_blank.png');
114 define ('PDF_PAGE_FORMAT', 'A4');
117 * page orientation (P=portrait, L=landscape)
119 define ('PDF_PAGE_ORIENTATION', 'P');
124 define ('PDF_CREATOR', 'TCPDF');
129 define ('PDF_AUTHOR', 'TCPDF');
134 define ('PDF_HEADER_TITLE', 'TCPDF Example');
137 * header description string
139 define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
144 define ('PDF_HEADER_LOGO', 'tcpdf_logo.jpg');
147 * header logo image width [mm]
149 define ('PDF_HEADER_LOGO_WIDTH', 30);
152 * document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch]
154 define ('PDF_UNIT', 'mm');
159 define ('PDF_MARGIN_HEADER', 5);
164 define ('PDF_MARGIN_FOOTER', 10);
169 define ('PDF_MARGIN_TOP', 27);
174 define ('PDF_MARGIN_BOTTOM', 25);
179 define ('PDF_MARGIN_LEFT', 15);
184 define ('PDF_MARGIN_RIGHT', 15);
187 * default main font name
189 define ('PDF_FONT_NAME_MAIN', 'helvetica');
192 * default main font size
194 define ('PDF_FONT_SIZE_MAIN', 10);
197 * default data font name
199 define ('PDF_FONT_NAME_DATA', 'helvetica');
202 * default data font size
204 define ('PDF_FONT_SIZE_DATA', 8);
207 * default monospaced font name
209 define ('PDF_FONT_MONOSPACED', 'courier');
212 * ratio used to adjust the conversion of pixels to user units
214 define ('PDF_IMAGE_SCALE_RATIO', 1.25);
217 * magnification factor for titles
219 define('HEAD_MAGNIFICATION', 1.1);
222 * height of cell respect font height
224 define('K_CELL_HEIGHT_RATIO', 1.25);
227 * title magnification respect main font size
229 define('K_TITLE_MAGNIFICATION', 1.3);
232 * reduction factor for small font
234 define('K_SMALL_RATIO', 2/3);
237 * set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language
239 define('K_THAI_TOPCHARS', true);
242 * if true allows to call TCPDF methods using HTML syntax
243 * IMPORTANT: For security reason, disable this feature if you are printing user HTML content.
245 define('K_TCPDF_CALLS_IN_HTML', true);
248 //============================================================+
250 //============================================================+