]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - include/tcpdf/config/tcpdf_config.php
Release 6.5.0
[Github/sugarcrm.git] / include / tcpdf / config / tcpdf_config.php
1 <?php
2
3 /*
4
5 Modification information for LGPL compliance
6
7 r57813 - 2010-08-19 10:34:44 -0700 (Thu, 19 Aug 2010) - kjing - Author: John Mertic <jmertic@sugarcrm.com>
8     Bug 39085 - When loading the opposite search panel via ajax on the ListViews, call the index action instead of the ListView action to avoid touching pre-MVC code by accident.
9
10 r56990 - 2010-06-16 13:05:36 -0700 (Wed, 16 Jun 2010) - kjing - snapshot "Mango" svn branch to a new one for GitHub sync
11
12 r56989 - 2010-06-16 13:01:33 -0700 (Wed, 16 Jun 2010) - kjing - defunt "Mango" svn dev branch before github cutover
13
14 r55980 - 2010-04-19 13:31:28 -0700 (Mon, 19 Apr 2010) - kjing - create Mango (6.1) based on windex
15
16 r51719 - 2009-10-22 10:18:00 -0700 (Thu, 22 Oct 2009) - mitani - Converted to Build 3  tags and updated the build system
17
18 r51634 - 2009-10-19 13:32:22 -0700 (Mon, 19 Oct 2009) - mitani - Windex is the branch for Sugar Sales 1.0 development
19
20 r50375 - 2009-08-24 18:07:43 -0700 (Mon, 24 Aug 2009) - dwong - branch kobe2 from tokyo r50372
21
22 r46451 - 2009-04-23 16:57:40 -0700 (Thu, 23 Apr 2009) - jenny - tcpdf initial checkin.
23
24
25 */
26
27
28 //============================================================+
29 // File name   : tcpdf_config.php
30 // Begin       : 2004-06-11
31 // Last Update : 2009-03-18
32 //
33 // Description : Configuration file for TCPDF.
34 //
35 // Author: Nicola Asuni
36 //
37 // (c) Copyright:
38 //               Nicola Asuni
39 //               Tecnick.com s.r.l.
40 //               Via Della Pace, 11
41 //               09044 Quartucciu (CA)
42 //               ITALY
43 //               www.tecnick.com
44 //               info@tecnick.com
45 //============================================================+
46
47 /**
48  * Configuration file for TCPDF.
49  * @author Nicola Asuni
50  * @copyright 2004-2008 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
51  * @package com.tecnick.tcpdf
52  * @version 4.0.014
53  * @link http://tcpdf.sourceforge.net
54  * @license http://www.gnu.org/copyleft/lesser.html LGPL
55  * @since 2004-10-27
56  */
57
58 // If you define the constant K_TCPDF_EXTERNAL_CONFIG, the following settings will be ignored.
59
60 if (!defined('K_TCPDF_EXTERNAL_CONFIG')) {
61
62         // DOCUMENT_ROOT fix for IIS Webserver
63         if ((!isset($_SERVER['DOCUMENT_ROOT'])) OR (empty($_SERVER['DOCUMENT_ROOT']))) {
64                 if(isset($_SERVER['SCRIPT_FILENAME'])) {
65                         $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])));
66                 } elseif(isset($_SERVER['PATH_TRANSLATED'])) {
67                         $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF'])));
68                 }       else {
69                         // define here your DOCUMENT_ROOT path if the previous fails
70                         $_SERVER['DOCUMENT_ROOT'] = '/var/www';
71                 }
72         }
73
74         // Automatic calculation for the following K_PATH_MAIN constant
75         $k_path_main = str_replace( '\\', '/', realpath(substr(dirname(__FILE__), 0, 0-strlen('config'))));
76         if (substr($k_path_main, -1) != '/') {
77                 $k_path_main .= '/';
78         }
79
80         /**
81          * Installation path (/var/www/tcpdf/).
82          * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
83          */
84         define ('K_PATH_MAIN', $k_path_main);
85
86         // Automatic calculation for the following K_PATH_URL constant
87         if (isset($_SERVER['HTTP_HOST']) AND (!empty($_SERVER['HTTP_HOST']))) {
88                 if(isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND strtolower($_SERVER['HTTPS'])!='off') {
89                         $k_path_url = 'https://';
90                 } else {
91                         $k_path_url = 'http://';
92                 }
93                 $k_path_url .= $_SERVER['HTTP_HOST'];
94                 $k_path_url .= str_replace( '\\', '/', substr($_SERVER['PHP_SELF'], 0, -24));
95         } else {
96             $k_path_url = '';
97         }
98
99         /**
100          * URL path to tcpdf installation folder (http://localhost/tcpdf/).
101          * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
102          */
103         define ('K_PATH_URL', $k_path_url);
104
105         /**
106          * path for PDF fonts
107          * use K_PATH_MAIN.'fonts/old/' for old non-UTF8 fonts
108          */
109         define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/');
110
111         /**
112          * cache directory for temporary files (full path)
113          */
114         define ('K_PATH_CACHE', sugar_cached(K_PATH_MAIN));
115
116         /**
117          * cache directory for temporary files (url path)
118          */
119         define ('K_PATH_URL_CACHE', "cache/".K_PATH_URL);
120
121         /**
122          *images directory
123          */
124         define ('K_PATH_IMAGES', K_PATH_MAIN.'images/');
125
126         /**
127          * blank image
128          */
129         define ('K_BLANK_IMAGE', K_PATH_IMAGES.'_blank.png');
130
131         /**
132          * page format
133          */
134         define ('PDF_PAGE_FORMAT', 'A4');
135
136         /**
137          * page orientation (P=portrait, L=landscape)
138          */
139         define ('PDF_PAGE_ORIENTATION', 'P');
140
141         /**
142          * document creator
143          */
144         define ('PDF_CREATOR', 'TCPDF');
145
146         /**
147          * document author
148          */
149         define ('PDF_AUTHOR', 'TCPDF');
150
151         /**
152          * header title
153          */
154         define ('PDF_HEADER_TITLE', 'TCPDF Example');
155
156         /**
157          * header description string
158          */
159         define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
160
161         /**
162          * image logo
163          */
164         define ('PDF_HEADER_LOGO', 'tcpdf_logo.jpg');
165
166         /**
167          * header logo image width [mm]
168          */
169         define ('PDF_HEADER_LOGO_WIDTH', 30);
170
171         /**
172          *  document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch]
173          */
174         define ('PDF_UNIT', 'mm');
175
176         /**
177          * header margin
178          */
179         define ('PDF_MARGIN_HEADER', 5);
180
181         /**
182          * footer margin
183          */
184         define ('PDF_MARGIN_FOOTER', 10);
185
186         /**
187          * top margin
188          */
189         define ('PDF_MARGIN_TOP', 27);
190
191         /**
192          * bottom margin
193          */
194         define ('PDF_MARGIN_BOTTOM', 25);
195
196         /**
197          * left margin
198          */
199         define ('PDF_MARGIN_LEFT', 15);
200
201         /**
202          * right margin
203          */
204         define ('PDF_MARGIN_RIGHT', 15);
205
206         /**
207          * default main font name
208          */
209         define ('PDF_FONT_NAME_MAIN', 'helvetica');
210
211         /**
212          * default main font size
213          */
214         define ('PDF_FONT_SIZE_MAIN', 10);
215
216         /**
217          * default data font name
218          */
219         define ('PDF_FONT_NAME_DATA', 'helvetica');
220
221         /**
222          * default data font size
223          */
224         define ('PDF_FONT_SIZE_DATA', 8);
225
226         /**
227          * default monospaced font name
228          */
229         define ('PDF_FONT_MONOSPACED', 'courier');
230
231         /**
232          * Ratio used to scale the images
233          */
234         define ('PDF_IMAGE_SCALE_RATIO', 4);
235
236         /**
237          * magnification factor for titles
238          */
239         define('HEAD_MAGNIFICATION', 1.1);
240
241         /**
242          * height of cell repect font height
243          */
244         define('K_CELL_HEIGHT_RATIO', 1.25);
245
246         /**
247          * title magnification respect main font size
248          */
249         define('K_TITLE_MAGNIFICATION', 1.3);
250
251         /**
252          * reduction factor for small font
253          */
254         define('K_SMALL_RATIO', 2/3);
255
256         /**
257          * if true allows to call TCPDF methods using HTML syntax
258          * IMPORTANT: For security reason, disable this feature if you are printing user HTML content.
259          */
260         define('K_TCPDF_CALLS_IN_HTML', true);
261 }
262
263 //============================================================+
264 // END OF FILE
265 //============================================================+
266 ?>