Source for file pdfexportconfig.php

Documentation is available at pdfexportconfig.php

  1. <?php
  2. /**
  3. * Configure the TCPDF library for PDF generation
  4. *
  5. @author    Stuart Prescott
  6. @copyright  Copyright Stuart Prescott
  7. @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  8. @version    $Id: pdfexportconfig.php,v 1.2 2006/12/14 22:50:51 themill Exp $
  9. @package    Bumblebee
  10. @subpackage Export
  11. *
  12. *  path (bumblebee root)/inc/export/pdfexportconfig.php
  13. */
  14.  
  15. /** Load ancillary functions */
  16. require_once 'inc/typeinfo.php';
  17.  
  18. require_once 'inc/bb/configreader.php';
  19. $conf ConfigReader::getInstance();
  20.  
  21. /** make TCPDF use our configuration and not its default config */
  22. define ("K_TCPDF_EXTERNAL_CONFIG"true);
  23.  
  24. /** base path to the TCPDF classes */
  25. define ("K_PATH_MAIN"$conf->value('pdfexport''pdflibrary''system-inc/tcpdf/'));
  26.  
  27.  
  28. // ========================================================================
  29. // Following settings are as per the original TCPDF config file but must be
  30. // replicated here.
  31.  
  32. /**
  33. * url path
  34. */
  35. define ("K_PATH_URL""http://localhost/_OPENSOURCE/tcpdf/");
  36.  
  37. /**
  38. * path for PDF fonts
  39. */
  40. define ("FPDF_FONTPATH"K_PATH_MAIN."fonts/");
  41.  
  42. /**
  43. * cache directory for temporary files (full path)
  44. */
  45. define ("K_PATH_CACHE"K_PATH_MAIN."cache/");
  46.  
  47. /**
  48. * cache directory for temporary files (url path)
  49. */
  50. define ("K_PATH_URL_CACHE"K_PATH_URL."cache/");
  51.  
  52. /**
  53. *images directory
  54. */
  55. define ("K_PATH_IMAGES"K_PATH_MAIN."images/");
  56.  
  57. /**
  58. * blank image
  59. */
  60. define ("K_BLANK_IMAGE"K_PATH_IMAGES."_blank.png");
  61.  
  62. /**
  63. * page format
  64. */
  65. define ("PDF_PAGE_FORMAT""A4");
  66.  
  67. /**
  68. * page orientation (P=portrait, L=landscape)
  69. */
  70. define ("PDF_PAGE_ORIENTATION""P");
  71.  
  72. /**
  73. * document creator
  74. */
  75. define ("PDF_CREATOR""TCPDF");
  76.  
  77. /**
  78. * document author
  79. */
  80. define ("PDF_AUTHOR""pdf author");
  81.  
  82. /**
  83. * header title
  84. */
  85. define ("PDF_HEADER_TITLE""header title");
  86.  
  87. /**
  88. * header description string
  89. */
  90. define ("PDF_HEADER_STRING""first row\nsecond row\nthird row");
  91.  
  92. /**
  93. * image logo
  94. */
  95. define ("PDF_HEADER_LOGO""logo_example.png");
  96.  
  97. /**
  98. * header logo image width [mm]
  99. */
  100. define ("PDF_HEADER_LOGO_WIDTH"20);
  101.  
  102. /**
  103. *  document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch]
  104. */
  105. define ("PDF_UNIT""mm");
  106.  
  107. /**
  108. * header margin
  109. */
  110. define ("PDF_MARGIN_HEADER"5);
  111.  
  112. /**
  113. * footer margin
  114. */
  115. define ("PDF_MARGIN_FOOTER"10);
  116.  
  117. /**
  118. * top margin
  119. */
  120. define ("PDF_MARGIN_TOP"27);
  121.  
  122. /**
  123. * bottom margin
  124. */
  125. define ("PDF_MARGIN_BOTTOM"25);
  126.  
  127. /**
  128. * left margin
  129. */
  130. define ("PDF_MARGIN_LEFT"15);
  131.  
  132. /**
  133. * right margin
  134. */
  135. define ("PDF_MARGIN_RIGHT"15);
  136.  
  137. /**
  138. * main font name
  139. */
  140. define ("PDF_FONT_NAME_MAIN""FreeSans")//vera
  141.  
  142. /**
  143. * main font size
  144. */
  145. define ("PDF_FONT_SIZE_MAIN"10);
  146.  
  147. /**
  148. * data font name
  149. */
  150. define ("PDF_FONT_NAME_DATA""FreeSerif")//verase
  151.  
  152. /**
  153. * data font size
  154. */
  155. define ("PDF_FONT_SIZE_DATA"8);
  156.  
  157. /**
  158. *  scale factor for images (number of points in user unit)
  159. */
  160. define ("PDF_IMAGE_SCALE_RATIO"4);
  161.  
  162. /**
  163. * magnification factor for titles
  164. */
  165. define("HEAD_MAGNIFICATION"1.1);
  166.  
  167. /**
  168. * height of cell repect font height
  169. */
  170. define("K_CELL_HEIGHT_RATIO"1.25);
  171.  
  172. /**
  173. * title magnification respect main font size
  174. */
  175. define("K_TITLE_MAGNIFICATION"1.3);
  176.  
  177. /**
  178. * reduction factor for small font
  179. */
  180. define("K_SMALL_RATIO"2/3);
  181.  
  182.  
  183. // ========================================================================
  184. // Finally, after the config is read in, load the PDF library
  185. /** TCPDF free PDF creation library for PHP: http://sf.net/projects/tcpdf */
  186. require_once 'tcpdf/tcpdf.php';
  187.  
  188. ?>

Documentation generated on Tue, 06 Mar 2007 10:01:53 +0000 by phpDocumentor 1.3.0