[347] | 1 | <?php
|
---|
| 2 | //============================================================+
|
---|
| 3 | // File name : tcpdf_config.php
|
---|
| 4 | // Begin : 2004-06-11
|
---|
| 5 | // Last Update : 2013-02-06
|
---|
| 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 |
|
---|
| 31 | /**
|
---|
| 32 | * Configuration file for TCPDF.
|
---|
| 33 | * @author Nicola Asuni
|
---|
| 34 | * @package com.tecnick.tcpdf
|
---|
| 35 | * @version 4.9.005
|
---|
| 36 | * @since 2004-10-27
|
---|
| 37 | */
|
---|
| 38 |
|
---|
| 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 | define('K_TCPDF_EXTERNAL_CONFIG', true);
|
---|
| 44 |
|
---|
| 45 | // DOCUMENT_ROOT fix for IIS Webserver
|
---|
| 46 | if ((!isset($_SERVER['DOCUMENT_ROOT'])) or (empty($_SERVER['DOCUMENT_ROOT']))) {
|
---|
| 47 | if (isset($_SERVER['SCRIPT_FILENAME'])) {
|
---|
| 48 | $_SERVER['DOCUMENT_ROOT'] = str_replace(
|
---|
| 49 | '\\',
|
---|
| 50 | '/',
|
---|
| 51 | substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF']))
|
---|
| 52 | );
|
---|
| 53 | } elseif (isset($_SERVER['PATH_TRANSLATED'])) {
|
---|
| 54 | $_SERVER['DOCUMENT_ROOT'] = str_replace(
|
---|
| 55 | '\\',
|
---|
| 56 | '/',
|
---|
| 57 | substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF']))
|
---|
| 58 | );
|
---|
| 59 | } else {
|
---|
| 60 | // define here your DOCUMENT_ROOT path if the previous fails (e.g. '/var/www')
|
---|
| 61 | $_SERVER['DOCUMENT_ROOT'] = '/var/www';
|
---|
| 62 | }
|
---|
| 63 | }
|
---|
| 64 |
|
---|
| 65 | // be sure that the end slash is present
|
---|
| 66 | $_SERVER['DOCUMENT_ROOT'] = str_replace('//', '/', $_SERVER['DOCUMENT_ROOT'].'/');
|
---|
| 67 |
|
---|
| 68 | /**
|
---|
| 69 | * Installation path of tcpdf with composer.
|
---|
| 70 | */
|
---|
| 71 | $vendorFolders = array(
|
---|
| 72 | dirname(dirname(dirname(__FILE__))) . '/vendor/',
|
---|
| 73 | dirname(dirname(dirname(__FILE__))) . '/../../',
|
---|
| 74 | );
|
---|
| 75 | foreach ($vendorFolders as $vendorFolder) {
|
---|
| 76 | if (file_exists($vendorFolder.'autoload.php')) {
|
---|
| 77 | $k_path_main = $vendorFolder . 'tecnickcom/tcpdf/';
|
---|
| 78 |
|
---|
| 79 | break;
|
---|
| 80 | }
|
---|
| 81 | }
|
---|
| 82 |
|
---|
| 83 | if (!isset($k_path_main)) {
|
---|
| 84 | echo "
|
---|
| 85 | [ERROR]
|
---|
| 86 | It seems that Html2Pdf dependencies are not installed...
|
---|
| 87 | you must install thems with `composer install`
|
---|
| 88 |
|
---|
| 89 | ";
|
---|
| 90 | exit;
|
---|
| 91 | }
|
---|
| 92 | define('K_PATH_MAIN', $k_path_main);
|
---|
| 93 |
|
---|
| 94 | // Automatic calculation for the following K_PATH_URL constant
|
---|
| 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 | /**
|
---|
| 107 | * URL path to tcpdf installation folder (http://localhost/tcpdf/).
|
---|
| 108 | * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
|
---|
| 109 | */
|
---|
| 110 | define('K_PATH_URL', $k_path_url);
|
---|
| 111 |
|
---|
| 112 | /**
|
---|
| 113 | * path for PDF fonts
|
---|
| 114 | * use K_PATH_MAIN.'fonts/old/' for old non-UTF8 fonts
|
---|
| 115 | */
|
---|
| 116 | define('K_PATH_FONTS', K_PATH_MAIN.'fonts/');
|
---|
| 117 |
|
---|
| 118 | /**
|
---|
| 119 | * cache directory for temporary files (url path)
|
---|
| 120 | */
|
---|
| 121 | define('K_PATH_URL_CACHE', K_PATH_URL.'cache/');
|
---|
| 122 |
|
---|
| 123 | /**
|
---|
| 124 | *images directory
|
---|
| 125 | */
|
---|
| 126 | define('K_PATH_IMAGES', K_PATH_MAIN.'images/');
|
---|
| 127 |
|
---|
| 128 | /**
|
---|
| 129 | * blank image
|
---|
| 130 | */
|
---|
| 131 | define('K_BLANK_IMAGE', K_PATH_IMAGES.'_blank.png');
|
---|
| 132 |
|
---|
| 133 | /**
|
---|
| 134 | * page format
|
---|
| 135 | */
|
---|
| 136 | define('PDF_PAGE_FORMAT', 'A4');
|
---|
| 137 |
|
---|
| 138 | /**
|
---|
| 139 | * page orientation (P=portrait, L=landscape)
|
---|
| 140 | */
|
---|
| 141 | define('PDF_PAGE_ORIENTATION', 'P');
|
---|
| 142 |
|
---|
| 143 | /**
|
---|
| 144 | * document creator
|
---|
| 145 | */
|
---|
| 146 | define('PDF_CREATOR', 'Html2Pdf - TCPDF');
|
---|
| 147 |
|
---|
| 148 | /**
|
---|
| 149 | * document author
|
---|
| 150 | */
|
---|
| 151 | define('PDF_AUTHOR', 'Html2Pdf - TCPDF');
|
---|
| 152 |
|
---|
| 153 | /**
|
---|
| 154 | * header title
|
---|
| 155 | */
|
---|
| 156 | define('PDF_HEADER_TITLE', null);
|
---|
| 157 |
|
---|
| 158 | /**
|
---|
| 159 | * header description string
|
---|
| 160 | */
|
---|
| 161 | define('PDF_HEADER_STRING', null);
|
---|
| 162 |
|
---|
| 163 | /**
|
---|
| 164 | * image logo
|
---|
| 165 | */
|
---|
| 166 | define('PDF_HEADER_LOGO', null);
|
---|
| 167 |
|
---|
| 168 | /**
|
---|
| 169 | * header logo image width [mm]
|
---|
| 170 | */
|
---|
| 171 | define('PDF_HEADER_LOGO_WIDTH', null);
|
---|
| 172 |
|
---|
| 173 | /**
|
---|
| 174 | * document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch]
|
---|
| 175 | */
|
---|
| 176 | define('PDF_UNIT', 'mm');
|
---|
| 177 |
|
---|
| 178 | /**
|
---|
| 179 | * header margin
|
---|
| 180 | */
|
---|
| 181 | define('PDF_MARGIN_HEADER', 0);
|
---|
| 182 |
|
---|
| 183 | /**
|
---|
| 184 | * footer margin
|
---|
| 185 | */
|
---|
| 186 | define('PDF_MARGIN_FOOTER', 0);
|
---|
| 187 |
|
---|
| 188 | /**
|
---|
| 189 | * top margin
|
---|
| 190 | */
|
---|
| 191 | define('PDF_MARGIN_TOP', 0);
|
---|
| 192 |
|
---|
| 193 | /**
|
---|
| 194 | * bottom margin
|
---|
| 195 | */
|
---|
| 196 | define('PDF_MARGIN_BOTTOM', 0);
|
---|
| 197 |
|
---|
| 198 | /**
|
---|
| 199 | * left margin
|
---|
| 200 | */
|
---|
| 201 | define('PDF_MARGIN_LEFT', 0);
|
---|
| 202 |
|
---|
| 203 | /**
|
---|
| 204 | * right margin
|
---|
| 205 | */
|
---|
| 206 | define('PDF_MARGIN_RIGHT', 0);
|
---|
| 207 |
|
---|
| 208 | /**
|
---|
| 209 | * default main font name
|
---|
| 210 | */
|
---|
| 211 | define('PDF_FONT_NAME_MAIN', 'helvetica');
|
---|
| 212 |
|
---|
| 213 | /**
|
---|
| 214 | * default main font size
|
---|
| 215 | */
|
---|
| 216 | define('PDF_FONT_SIZE_MAIN', 10);
|
---|
| 217 |
|
---|
| 218 | /**
|
---|
| 219 | * default data font name
|
---|
| 220 | */
|
---|
| 221 | define('PDF_FONT_NAME_DATA', 'helvetica');
|
---|
| 222 |
|
---|
| 223 | /**
|
---|
| 224 | * default data font size
|
---|
| 225 | */
|
---|
| 226 | define('PDF_FONT_SIZE_DATA', 8);
|
---|
| 227 |
|
---|
| 228 | /**
|
---|
| 229 | * default monospaced font name
|
---|
| 230 | */
|
---|
| 231 | define('PDF_FONT_MONOSPACED', 'courier');
|
---|
| 232 |
|
---|
| 233 | /**
|
---|
| 234 | * ratio used to adjust the conversion of pixels to user units
|
---|
| 235 | */
|
---|
| 236 | define('PDF_IMAGE_SCALE_RATIO', 1);
|
---|
| 237 |
|
---|
| 238 | /**
|
---|
| 239 | * magnification factor for titles
|
---|
| 240 | */
|
---|
| 241 | define('HEAD_MAGNIFICATION', 1);
|
---|
| 242 |
|
---|
| 243 | /**
|
---|
| 244 | * height of cell respect font height
|
---|
| 245 | */
|
---|
| 246 | define('K_CELL_HEIGHT_RATIO', 1);
|
---|
| 247 |
|
---|
| 248 | /**
|
---|
| 249 | * title magnification respect main font size
|
---|
| 250 | */
|
---|
| 251 | define('K_TITLE_MAGNIFICATION', 1);
|
---|
| 252 |
|
---|
| 253 | /**
|
---|
| 254 | * reduction factor for small font
|
---|
| 255 | */
|
---|
| 256 | define('K_SMALL_RATIO', 2/3);
|
---|
| 257 |
|
---|
| 258 | /**
|
---|
| 259 | * set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language
|
---|
| 260 | */
|
---|
| 261 | define('K_THAI_TOPCHARS', true);
|
---|
| 262 |
|
---|
| 263 | /**
|
---|
| 264 | * if true allows to call TCPDF methods using HTML syntax
|
---|
| 265 | * IMPORTANT: For security reason, disable this feature if you are printing user HTML content.
|
---|
| 266 | */
|
---|
| 267 | define('K_TCPDF_CALLS_IN_HTML', false);
|
---|
| 268 |
|
---|
| 269 | /**
|
---|
| 270 | * if true and PHP version is greater than 5, then the Error() method throw new exception instead of terminating the execution.
|
---|
| 271 | */
|
---|
| 272 | define('K_TCPDF_THROW_EXCEPTION_ERROR', true);
|
---|
| 273 | }
|
---|
| 274 |
|
---|
| 275 | //============================================================+
|
---|
| 276 | // END OF FILE
|
---|
| 277 | //============================================================+
|
---|