tcpdf_config.php 5.8 KB

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