PageRenderTime 54ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/plugins/ScheduledReports/config/tcpdf_config.php

https://github.com/CodeYellowBV/piwik
PHP | 245 lines | 220 code | 8 blank | 17 comment | 6 complexity | 3445e7f15f8d2f099cd0501b296cffd6 MD5 | raw file
Possible License(s): LGPL-3.0, JSON, MIT, GPL-3.0, LGPL-2.1, GPL-2.0, AGPL-1.0, BSD-2-Clause, BSD-3-Clause
  1. <?php
  2. /**
  3. * Piwik - free/libre analytics platform
  4. *
  5. * @link http://piwik.org
  6. * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
  7. *
  8. */
  9. /**
  10. * Override settings in libs/tcpdf_config.php
  11. *
  12. */
  13. define('K_PATH_MAIN', PIWIK_INCLUDE_PATH . '/libs/tcpdf/');
  14. $pathTmpTCPDF = PIWIK_USER_PATH . '/tmp/tcpdf/';
  15. $pathTmpTCPDF = \Piwik\SettingsPiwik::rewriteTmpPathWithInstanceId($pathTmpTCPDF);
  16. define('K_PATH_CACHE', $pathTmpTCPDF);
  17. define('K_PATH_IMAGES', $pathTmpTCPDF);
  18. if (!defined('K_TCPDF_EXTERNAL_CONFIG')) {
  19. // DOCUMENT_ROOT fix for IIS Webserver
  20. if ((!isset($_SERVER['DOCUMENT_ROOT'])) OR (empty($_SERVER['DOCUMENT_ROOT']))) {
  21. if (isset($_SERVER['SCRIPT_FILENAME'])) {
  22. $_SERVER['DOCUMENT_ROOT'] = str_replace('\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0 - strlen($_SERVER['PHP_SELF'])));
  23. } elseif (isset($_SERVER['PATH_TRANSLATED'])) {
  24. $_SERVER['DOCUMENT_ROOT'] = str_replace('\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0 - strlen($_SERVER['PHP_SELF'])));
  25. } else {
  26. // define here your DOCUMENT_ROOT path if the previous fails
  27. $_SERVER['DOCUMENT_ROOT'] = '/var/www';
  28. }
  29. }
  30. if (!defined('K_PATH_MAIN')) {
  31. // Automatic calculation for the following K_PATH_MAIN constant
  32. $k_path_main = str_replace('\\', '/', realpath(substr(dirname(__FILE__), 0, 0 - strlen('config'))));
  33. if (substr($k_path_main, -1) != '/') {
  34. $k_path_main .= '/';
  35. }
  36. /**
  37. * Installation path (/var/www/tcpdf/).
  38. * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
  39. */
  40. if (!defined('K_PATH_MAIN')) {
  41. define ('K_PATH_MAIN', $k_path_main);
  42. }
  43. }
  44. if (!defined('K_PATH_URL')) {
  45. // Automatic calculation for the following K_PATH_URL constant
  46. $k_path_url = K_PATH_MAIN; // default value for console mode
  47. if (isset($_SERVER['HTTP_HOST']) AND (!empty($_SERVER['HTTP_HOST']))) {
  48. if (isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND strtolower($_SERVER['HTTPS']) != 'off') {
  49. $k_path_url = 'https://';
  50. } else {
  51. $k_path_url = 'http://';
  52. }
  53. $k_path_url .= $_SERVER['HTTP_HOST'];
  54. $k_path_url .= str_replace('\\', '/', substr(K_PATH_MAIN, (strlen($_SERVER['DOCUMENT_ROOT']) - 1)));
  55. }
  56. /**
  57. * URL path to tcpdf installation folder (http://localhost/tcpdf/).
  58. * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
  59. */
  60. define ('K_PATH_URL', $k_path_url);
  61. }
  62. /**
  63. * path for PDF fonts
  64. * use K_PATH_MAIN.'fonts/old/' for old non-UTF8 fonts
  65. */
  66. define ('K_PATH_FONTS', K_PATH_MAIN . 'fonts/');
  67. /**
  68. * cache directory for temporary files (full path)
  69. */
  70. if (!defined('K_PATH_CACHE')) {
  71. define ('K_PATH_CACHE', K_PATH_MAIN . 'cache/');
  72. }
  73. /**
  74. * cache directory for temporary files (url path)
  75. */
  76. define ('K_PATH_URL_CACHE', K_PATH_URL . 'cache/');
  77. /**
  78. *images directory
  79. */
  80. if (!defined('K_PATH_IMAGES')) {
  81. define ('K_PATH_IMAGES', K_PATH_MAIN . 'images/');
  82. }
  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. // define the constant K_TCPDF_EXTERNAL_CONFIG to ignore tcpdf's default settings
  198. define('K_TCPDF_EXTERNAL_CONFIG', true);
  199. //============================================================+
  200. // END OF FILE
  201. //============================================================+