tcpdf_config.php 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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 - 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-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. * Configuration file for TCPDF.
  32. * @author Nicola Asuni
  33. * @package com.tecnick.tcpdf
  34. * @version 4.9.005
  35. * @since 2004-10-27
  36. */
  37. // If you define the constant K_TCPDF_EXTERNAL_CONFIG, the following settings will be ignored.
  38. if (!defined('K_TCPDF_EXTERNAL_CONFIG')) {
  39. // DOCUMENT_ROOT fix for IIS Webserver
  40. if ((!isset($_SERVER['DOCUMENT_ROOT'])) OR (empty($_SERVER['DOCUMENT_ROOT']))) {
  41. if(isset($_SERVER['SCRIPT_FILENAME'])) {
  42. $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])));
  43. } elseif(isset($_SERVER['PATH_TRANSLATED'])) {
  44. $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF'])));
  45. } else {
  46. // define here your DOCUMENT_ROOT path if the previous fails (e.g. '/var/www')
  47. $_SERVER['DOCUMENT_ROOT'] = '/';
  48. }
  49. }
  50. // be sure that the end slash is present
  51. $_SERVER['DOCUMENT_ROOT'] = str_replace('//', '/', $_SERVER['DOCUMENT_ROOT'].'/');
  52. // Automatic calculation for the following K_PATH_MAIN constant
  53. $k_path_main = str_replace( '\\', '/', realpath(substr(dirname(__FILE__), 0, 0-strlen('config'))));
  54. if (substr($k_path_main, -1) != '/') {
  55. $k_path_main .= '/';
  56. }
  57. /**
  58. * Installation path (/var/www/tcpdf/).
  59. * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
  60. */
  61. define ('K_PATH_MAIN', $k_path_main);
  62. // Automatic calculation for the following K_PATH_URL constant
  63. $k_path_url = $k_path_main; // default value for console mode
  64. if (isset($_SERVER['HTTP_HOST']) AND (!empty($_SERVER['HTTP_HOST']))) {
  65. if(isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND strtolower($_SERVER['HTTPS'])!='off') {
  66. $k_path_url = 'https://';
  67. } else {
  68. $k_path_url = 'http://';
  69. }
  70. $k_path_url .= $_SERVER['HTTP_HOST'];
  71. $k_path_url .= str_replace( '\\', '/', substr(K_PATH_MAIN, (strlen($_SERVER['DOCUMENT_ROOT']) - 1)));
  72. }
  73. /**
  74. * URL path to tcpdf installation folder (http://localhost/tcpdf/).
  75. * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
  76. */
  77. define ('K_PATH_URL', $k_path_url);
  78. /**
  79. * path for PDF fonts
  80. * use K_PATH_MAIN.'fonts/old/' for old non-UTF8 fonts
  81. */
  82. define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/');
  83. /**
  84. * cache directory for temporary files (full path)
  85. */
  86. define ('K_PATH_CACHE', K_PATH_MAIN.'cache/');
  87. /**
  88. * cache directory for temporary files (url path)
  89. */
  90. define ('K_PATH_URL_CACHE', K_PATH_URL.'cache/');
  91. /**
  92. *images directory
  93. */
  94. define ('K_PATH_IMAGES', K_PATH_MAIN.'images/');
  95. /**
  96. * blank image
  97. */
  98. define ('K_BLANK_IMAGE', K_PATH_IMAGES.'_blank.png');
  99. /**
  100. * page format
  101. */
  102. define ('PDF_PAGE_FORMAT', 'A4');
  103. /**
  104. * page orientation (P=portrait, L=landscape)
  105. */
  106. define ('PDF_PAGE_ORIENTATION', 'P');
  107. /**
  108. * document creator
  109. */
  110. define ('PDF_CREATOR', 'TCPDF');
  111. /**
  112. * document author
  113. */
  114. define ('PDF_AUTHOR', 'TCPDF');
  115. /**
  116. * header title
  117. */
  118. define ('PDF_HEADER_TITLE', 'TCPDF Example');
  119. /**
  120. * header description string
  121. */
  122. define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
  123. /**
  124. * image logo
  125. */
  126. define ('PDF_HEADER_LOGO', 'tcpdf_logo.jpg');
  127. /**
  128. * header logo image width [mm]
  129. */
  130. define ('PDF_HEADER_LOGO_WIDTH', 30);
  131. /**
  132. * document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch]
  133. */
  134. define ('PDF_UNIT', 'mm');
  135. /**
  136. * header margin
  137. */
  138. define ('PDF_MARGIN_HEADER', 5);
  139. /**
  140. * footer margin
  141. */
  142. define ('PDF_MARGIN_FOOTER', 10);
  143. /**
  144. * top margin
  145. */
  146. define ('PDF_MARGIN_TOP', 27);
  147. /**
  148. * bottom margin
  149. */
  150. define ('PDF_MARGIN_BOTTOM', 25);
  151. /**
  152. * left margin
  153. */
  154. define ('PDF_MARGIN_LEFT', 15);
  155. /**
  156. * right margin
  157. */
  158. define ('PDF_MARGIN_RIGHT', 15);
  159. /**
  160. * default main font name
  161. */
  162. define ('PDF_FONT_NAME_MAIN', 'helvetica');
  163. /**
  164. * default main font size
  165. */
  166. define ('PDF_FONT_SIZE_MAIN', 10);
  167. /**
  168. * default data font name
  169. */
  170. define ('PDF_FONT_NAME_DATA', 'helvetica');
  171. /**
  172. * default data font size
  173. */
  174. define ('PDF_FONT_SIZE_DATA', 8);
  175. /**
  176. * default monospaced font name
  177. */
  178. define ('PDF_FONT_MONOSPACED', 'courier');
  179. /**
  180. * ratio used to adjust the conversion of pixels to user units
  181. */
  182. define ('PDF_IMAGE_SCALE_RATIO', 1.25);
  183. /**
  184. * magnification factor for titles
  185. */
  186. define('HEAD_MAGNIFICATION', 1.1);
  187. /**
  188. * height of cell respect font height
  189. */
  190. define('K_CELL_HEIGHT_RATIO', 1.25);
  191. /**
  192. * title magnification respect main font size
  193. */
  194. define('K_TITLE_MAGNIFICATION', 1.3);
  195. /**
  196. * reduction factor for small font
  197. */
  198. define('K_SMALL_RATIO', 2/3);
  199. /**
  200. * set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language
  201. */
  202. define('K_THAI_TOPCHARS', true);
  203. /**
  204. * if true allows to call TCPDF methods using HTML syntax
  205. * IMPORTANT: For security reason, disable this feature if you are printing user HTML content.
  206. */
  207. define('K_TCPDF_CALLS_IN_HTML', true);
  208. /**
  209. * if true adn PHP version is greater than 5, then the Error() method throw new exception instead of terminating the execution.
  210. */
  211. define('K_TCPDF_THROW_EXCEPTION_ERROR', false);
  212. }
  213. //============================================================+
  214. // END OF FILE
  215. //============================================================+