tcpdfConfig.php 6.2 KB

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