ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
tcpdf_config.php
Go to the documentation of this file.
1 <?php
2 //============================================================+
3 // File name : tcpdf_config.php
4 // Begin : 2004-06-11
5 // Last Update : 2013-05-14
6 //
7 // Description : Configuration file for TCPDF.
8 // Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
9 // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
10 // -------------------------------------------------------------------
11 // Copyright (C) 2004-2013 Nicola Asuni - Tecnick.com LTD
12 //
13 // This file is part of TCPDF software library.
14 //
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.
19 //
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.
24 //
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/>.
27 //
28 // See LICENSE.TXT file for more information.
29 //============================================================+
30 
39 // If you define the constant K_TCPDF_EXTERNAL_CONFIG, the following settings will be ignored.
40 
41 if (!defined('K_TCPDF_EXTERNAL_CONFIG')) {
42 
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'])));
49  } else {
50  // define here your DOCUMENT_ROOT path if the previous fails (e.g. '/var/www')
51  $_SERVER['DOCUMENT_ROOT'] = '/';
52  }
53  }
54  // be sure that the end slash is present
55  $_SERVER['DOCUMENT_ROOT'] = str_replace('//', '/', $_SERVER['DOCUMENT_ROOT'].'/');
56 
57  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
58  // Try to automatically set the value for the following K_PATH_MAIN constant.
59  // NOTE: delete this section and manually set the K_PATH_MAIN constant below for better performances.
60  // PATCH BEGIN: ILIAS
61  if( false ) {
62  // PATCH END: ILIAS
63  $tcpdf_install_dirs = array();
64  if (strpos(dirname(__FILE__), '/config') !== false) {
65  // default config file
66  $k_path_main_default = str_replace( '\\', '/', realpath(substr(dirname(__FILE__), 0, 0-strlen('config'))));
67  if (substr($k_path_main_default, -1) != '/') {
68  $k_path_main_default .= '/';
69  }
70  $tcpdf_install_dirs[] = $k_path_main_default;
71  }
72  $tcpdf_install_dirs += array('/usr/share/php/tcpdf/', '/usr/share/tcpdf/', '/usr/share/php-tcpdf/', '/var/www/tcpdf/', '/var/www/html/tcpdf/', '/usr/local/apache2/htdocs/tcpdf/');
73  foreach ($tcpdf_install_dirs as $k_path_main) {
74  if (file_exists($k_path_main.'tcpdf.php')) {
75  break;
76  }
77  }
78  // PATCH BEGIN: ILIAS
79  } $k_path_main = dirname(dirname(__FILE__)).'/';
80  // PATCH END: ILIAS
81  if (!file_exists($k_path_main)) {
82  die('TCPDF ERROR: please set the correct path to TCPDF on the configuration file');
83  }
84  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
85 
90  define ('K_PATH_MAIN', $k_path_main);
91 
92  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
93  // Try to automatically set the value for the following K_PATH_URL constant.
94  // NOTE: delete this section and manually set the K_PATH_URL constant below for better performances.
95  $k_path_url = $k_path_main; // default value for console mode
96  if (isset($_SERVER['HTTP_HOST']) AND (!empty($_SERVER['HTTP_HOST']))) {
97  if(isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND (strtolower($_SERVER['HTTPS']) != 'off')) {
98  $k_path_url = 'https://';
99  } else {
100  $k_path_url = 'http://';
101  }
102  $k_path_url .= $_SERVER['HTTP_HOST'];
103  $k_path_url .= str_replace( '\\', '/', substr(K_PATH_MAIN, (strlen($_SERVER['DOCUMENT_ROOT']) - 1)));
104  }
105  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
106 
111  define ('K_PATH_URL', $k_path_url);
112 
116  define ('K_PATH_CACHE', sys_get_temp_dir().'/');
117 
121  define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/');
122 
126  define ('K_PATH_IMAGES', K_PATH_MAIN.'examples/images/');
127 
131  define ('K_BLANK_IMAGE', K_PATH_IMAGES.'_blank.png');
132 
136  define ('PDF_PAGE_FORMAT', 'A4');
137 
141  define ('PDF_PAGE_ORIENTATION', 'P');
142 
146  define ('PDF_CREATOR', 'TCPDF');
147 
151  define ('PDF_AUTHOR', 'TCPDF');
152 
156  define ('PDF_HEADER_TITLE', 'TCPDF Example');
157 
161  define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
162 
166  define ('PDF_HEADER_LOGO', 'tcpdf_logo.jpg');
167 
171  define ('PDF_HEADER_LOGO_WIDTH', 30);
172 
176  define ('PDF_UNIT', 'mm');
177 
181  define ('PDF_MARGIN_HEADER', 5);
182 
186  define ('PDF_MARGIN_FOOTER', 10);
187 
191  define ('PDF_MARGIN_TOP', 27);
192 
196  define ('PDF_MARGIN_BOTTOM', 25);
197 
201  define ('PDF_MARGIN_LEFT', 15);
202 
206  define ('PDF_MARGIN_RIGHT', 15);
207 
211  define ('PDF_FONT_NAME_MAIN', 'helvetica');
212 
216  define ('PDF_FONT_SIZE_MAIN', 10);
217 
221  define ('PDF_FONT_NAME_DATA', 'helvetica');
222 
226  define ('PDF_FONT_SIZE_DATA', 8);
227 
231  define ('PDF_FONT_MONOSPACED', 'courier');
232 
236  define ('PDF_IMAGE_SCALE_RATIO', 1.25);
237 
241  define('HEAD_MAGNIFICATION', 1.1);
242 
246  define('K_CELL_HEIGHT_RATIO', 1.25);
247 
251  define('K_TITLE_MAGNIFICATION', 1.3);
252 
256  define('K_SMALL_RATIO', 2/3);
257 
261  define('K_THAI_TOPCHARS', true);
262 
267  define('K_TCPDF_CALLS_IN_HTML', true);
268 
272  define('K_TCPDF_THROW_EXCEPTION_ERROR', false);
273 }
274 
275 //============================================================+
276 // END OF FILE
277 //============================================================+