com-tecnick-tcpdf
[ class tree: com-tecnick-tcpdf ] [ index: com-tecnick-tcpdf ] [ all elements ]

Source for file tcpdf_config.php

Documentation is available at tcpdf_config.php

  1. <?php
  2. //============================================================+
  3. // File name   : tcpdf_config.php
  4. // Begin       : 2004-06-11
  5. // Last Update : 2009-03-18
  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. /**
  22.  * Configuration file for TCPDF.
  23.  * @author Nicola Asuni
  24.  * @copyright 2004-2008 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) 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.  
  32. // If you define the constant K_TCPDF_EXTERNAL_CONFIG, the following settings will be ignored.
  33.  
  34. if (!defined('K_TCPDF_EXTERNAL_CONFIG')) {
  35.     
  36.     // DOCUMENT_ROOT fix for IIS Webserver
  37.     if ((!isset($_SERVER['DOCUMENT_ROOT'])) OR (empty($_SERVER['DOCUMENT_ROOT']))) {
  38.         if(isset($_SERVER['SCRIPT_FILENAME'])) {
  39.             $_SERVER['DOCUMENT_ROOT'str_replace'\\''/'substr($_SERVER['SCRIPT_FILENAME']00-strlen($_SERVER['PHP_SELF'])));
  40.         elseif(isset($_SERVER['PATH_TRANSLATED'])) {
  41.             $_SERVER['DOCUMENT_ROOT'str_replace'\\''/'substr(str_replace('\\\\''\\'$_SERVER['PATH_TRANSLATED'])00-strlen($_SERVER['PHP_SELF'])));
  42.         }    else {
  43.             // define here your DOCUMENT_ROOT path if the previous fails
  44.             $_SERVER['DOCUMENT_ROOT''/var/www';
  45.         }
  46.     }
  47.     
  48.     // Automatic calculation for the following K_PATH_MAIN constant
  49.     $k_path_main str_replace'\\''/'realpath(substr(dirname(__FILE__)00-strlen('config'))));
  50.     if (substr($k_path_main-1!= '/'{
  51.         $k_path_main .= '/';
  52.     }
  53.     
  54.     /**
  55.      * Installation path (/var/www/tcpdf/).
  56.      * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
  57.      */
  58.     define ('K_PATH_MAIN'$k_path_main);
  59.     
  60.     // Automatic calculation for the following K_PATH_URL constant
  61.     if (isset($_SERVER['HTTP_HOST']AND (!empty($_SERVER['HTTP_HOST']))) {
  62.         if(isset($_SERVER['HTTPS']AND (!empty($_SERVER['HTTPS'])) AND strtolower($_SERVER['HTTPS'])!='off'{
  63.             $k_path_url 'https://';
  64.         else {
  65.             $k_path_url 'http://';
  66.         }
  67.         $k_path_url .= $_SERVER['HTTP_HOST'];
  68.         $k_path_url .= str_replace'\\''/'substr($_SERVER['PHP_SELF']0-24));
  69.     }
  70.     
  71.     /**
  72.      * URL path to tcpdf installation folder (http://localhost/tcpdf/).
  73.      * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
  74.      */
  75.     define ('K_PATH_URL'$k_path_url);
  76.     
  77.     /**
  78.      * path for PDF fonts
  79.      * use K_PATH_MAIN.'fonts/old/' for old non-UTF8 fonts
  80.      */
  81.     define ('K_PATH_FONTS'K_PATH_MAIN.'fonts/');
  82.     
  83.     /**
  84.      * cache directory for temporary files (full path)
  85.      */
  86.     define ('K_PATH_CACHE'K_PATH_MAIN.'cache/');
  87.     
  88.     /**
  89.      * cache directory for temporary files (url path)
  90.      */
  91.     define ('K_PATH_URL_CACHE'K_PATH_URL.'cache/');
  92.     
  93.     /**
  94.      *images directory
  95.      */
  96.     define ('K_PATH_IMAGES'K_PATH_MAIN.'images/');
  97.     
  98.     /**
  99.      * blank image
  100.      */
  101.     define ('K_BLANK_IMAGE'K_PATH_IMAGES.'_blank.png');
  102.     
  103.     /**
  104.      * page format
  105.      */
  106.     define ('PDF_PAGE_FORMAT''A4');
  107.     
  108.     /**
  109.      * page orientation (P=portrait, L=landscape)
  110.      */
  111.     define ('PDF_PAGE_ORIENTATION''P');
  112.     
  113.     /**
  114.      * document creator
  115.      */
  116.     define ('PDF_CREATOR''TCPDF');
  117.     
  118.     /**
  119.      * document author
  120.      */
  121.     define ('PDF_AUTHOR''TCPDF');
  122.     
  123.     /**
  124.      * header title
  125.      */
  126.     define ('PDF_HEADER_TITLE''TCPDF Example');
  127.     
  128.     /**
  129.      * header description string
  130.      */
  131.     define ('PDF_HEADER_STRING'"by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
  132.     
  133.     /**
  134.      * image logo
  135.      */
  136.     define ('PDF_HEADER_LOGO''tcpdf_logo.jpg');
  137.     
  138.     /**
  139.      * header logo image width [mm]
  140.      */
  141.     define ('PDF_HEADER_LOGO_WIDTH'30);
  142.     
  143.     /**
  144.      *  document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch]
  145.      */
  146.     define ('PDF_UNIT''mm');
  147.     
  148.     /**
  149.      * header margin
  150.      */
  151.     define ('PDF_MARGIN_HEADER'5);
  152.     
  153.     /**
  154.      * footer margin
  155.      */
  156.     define ('PDF_MARGIN_FOOTER'10);
  157.     
  158.     /**
  159.      * top margin
  160.      */
  161.     define ('PDF_MARGIN_TOP'27);
  162.     
  163.     /**
  164.      * bottom margin
  165.      */
  166.     define ('PDF_MARGIN_BOTTOM'25);
  167.     
  168.     /**
  169.      * left margin
  170.      */
  171.     define ('PDF_MARGIN_LEFT'15);
  172.     
  173.     /**
  174.      * right margin
  175.      */
  176.     define ('PDF_MARGIN_RIGHT'15);
  177.     
  178.     /**
  179.      * default main font name
  180.      */
  181.     define ('PDF_FONT_NAME_MAIN''helvetica');
  182.     
  183.     /**
  184.      * default main font size
  185.      */
  186.     define ('PDF_FONT_SIZE_MAIN'10);
  187.     
  188.     /**
  189.      * default data font name
  190.      */
  191.     define ('PDF_FONT_NAME_DATA''helvetica');
  192.     
  193.     /**
  194.      * default data font size
  195.      */
  196.     define ('PDF_FONT_SIZE_DATA'8);
  197.     
  198.     /**
  199.      * default monospaced font name
  200.      */
  201.     define ('PDF_FONT_MONOSPACED''courier');
  202.     
  203.     /**
  204.      * Ratio used to scale the images
  205.      */
  206.     define ('PDF_IMAGE_SCALE_RATIO'4);
  207.     
  208.     /**
  209.      * magnification factor for titles
  210.      */
  211.     define('HEAD_MAGNIFICATION'1.1);
  212.     
  213.     /**
  214.      * height of cell repect font height
  215.      */
  216.     define('K_CELL_HEIGHT_RATIO'1.25);
  217.     
  218.     /**
  219.      * title magnification respect main font size
  220.      */
  221.     define('K_TITLE_MAGNIFICATION'1.3);
  222.     
  223.     /**
  224.      * reduction factor for small font
  225.      */
  226.     define('K_SMALL_RATIO'2/3);
  227. }
  228.  
  229. //============================================================+
  230. // END OF FILE                                                 
  231. //============================================================+
  232. ?>

Documentation generated on Wed, 22 Apr 2009 09:03:34 +0200 by phpDocumentor 1.4.1