tcpdf_config.php 5.5 KB

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