1<?php
2//============================================================+
3// File name   : tcpdf_config.php
4// Begin       : 2004-06-11
5// Last Update : 2011-04-15
6//
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
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
41if (!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
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) != '/') {
58		$k_path_main .= '/';
59	}
60
61	/**
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.
64	 */
65	define ('K_PATH_MAIN', $k_path_main);
66
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://';
72		} else {
73			$k_path_url = 'http://';
74		}
75		$k_path_url .= $_SERVER['HTTP_HOST'];
76		$k_path_url .= str_replace( '\\', '/', substr(K_PATH_MAIN, (strlen($_SERVER['DOCUMENT_ROOT']) - 1)));
77	}
78
79	/**
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.
82	 */
83	define ('K_PATH_URL', $k_path_url);
84
85	/**
86	 * path for PDF fonts
87	 * use K_PATH_MAIN.'fonts/old/' for old non-UTF8 fonts
88	 */
89	define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/');
90
91	/**
92	 * cache directory for temporary files (full path)
93	 */
94	define ('K_PATH_CACHE', K_PATH_MAIN.'cache/');
95
96	/**
97	 * cache directory for temporary files (url path)
98	 */
99	define ('K_PATH_URL_CACHE', K_PATH_URL.'cache/');
100
101	/**
102	 *images directory
103	 */
104	define ('K_PATH_IMAGES', K_PATH_MAIN.'images/');
105
106	/**
107	 * blank image
108	 */
109	define ('K_BLANK_IMAGE', K_PATH_IMAGES.'_blank.png');
110
111	/**
112	 * page format
113	 */
114	define ('PDF_PAGE_FORMAT', 'A4');
115
116	/**
117	 * page orientation (P=portrait, L=landscape)
118	 */
119	define ('PDF_PAGE_ORIENTATION', 'P');
120
121	/**
122	 * document creator
123	 */
124	define ('PDF_CREATOR', 'TCPDF');
125
126	/**
127	 * document author
128	 */
129	define ('PDF_AUTHOR', 'TCPDF');
130
131	/**
132	 * header title
133	 */
134	define ('PDF_HEADER_TITLE', 'TCPDF Example');
135
136	/**
137	 * header description string
138	 */
139	define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
140
141	/**
142	 * image logo
143	 */
144	define ('PDF_HEADER_LOGO', 'tcpdf_logo.jpg');
145
146	/**
147	 * header logo image width [mm]
148	 */
149	define ('PDF_HEADER_LOGO_WIDTH', 30);
150
151	/**
152	 *  document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch]
153	 */
154	define ('PDF_UNIT', 'mm');
155
156	/**
157	 * header margin
158	 */
159	define ('PDF_MARGIN_HEADER', 5);
160
161	/**
162	 * footer margin
163	 */
164	define ('PDF_MARGIN_FOOTER', 10);
165
166	/**
167	 * top margin
168	 */
169	define ('PDF_MARGIN_TOP', 27);
170
171	/**
172	 * bottom margin
173	 */
174	define ('PDF_MARGIN_BOTTOM', 25);
175
176	/**
177	 * left margin
178	 */
179	define ('PDF_MARGIN_LEFT', 15);
180
181	/**
182	 * right margin
183	 */
184	define ('PDF_MARGIN_RIGHT', 15);
185
186	/**
187	 * default main font name
188	 */
189	define ('PDF_FONT_NAME_MAIN', 'helvetica');
190
191	/**
192	 * default main font size
193	 */
194	define ('PDF_FONT_SIZE_MAIN', 10);
195
196	/**
197	 * default data font name
198	 */
199	define ('PDF_FONT_NAME_DATA', 'helvetica');
200
201	/**
202	 * default data font size
203	 */
204	define ('PDF_FONT_SIZE_DATA', 8);
205
206	/**
207	 * default monospaced font name
208	 */
209	define ('PDF_FONT_MONOSPACED', 'courier');
210
211	/**
212	 * ratio used to adjust the conversion of pixels to user units
213	 */
214	define ('PDF_IMAGE_SCALE_RATIO', 1.25);
215
216	/**
217	 * magnification factor for titles
218	 */
219	define('HEAD_MAGNIFICATION', 1.1);
220
221	/**
222	 * height of cell repect font height
223	 */
224	define('K_CELL_HEIGHT_RATIO', 1.25);
225
226	/**
227	 * title magnification respect main font size
228	 */
229	define('K_TITLE_MAGNIFICATION', 1.3);
230
231	/**
232	 * reduction factor for small font
233	 */
234	define('K_SMALL_RATIO', 2/3);
235
236	/**
237	 * set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language
238	 */
239	define('K_THAI_TOPCHARS', true);
240
241	/**
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.
244	 */
245	define('K_TCPDF_CALLS_IN_HTML', true);
246}
247
248//============================================================+
249// END OF FILE
250//============================================================+
251