tcpdf_config_alt.php 5.2 KB

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