From 8014a13226227ff3f9d5cf34ae9bc5f5106b7c4a Mon Sep 17 00:00:00 2001 From: nicolaasuni Date: Wed, 15 May 2013 17:56:20 +0100 Subject: [PATCH] 6.0.016 (2013-05-15) - The tcpdf_addfont.php tool was improved (thanks to Remi Collet). - Constant K_PATH_IMAGES is now automatically set in configuration file. --- config/tcpdf_config.php | 19 +++++++++++++++---- examples/config/tcpdf_config_alt.php | 17 ++++++++++++++--- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/config/tcpdf_config.php b/config/tcpdf_config.php index cb7bfd7..cc3f9c9 100644 --- a/config/tcpdf_config.php +++ b/config/tcpdf_config.php @@ -82,7 +82,7 @@ if (!defined('K_TCPDF_EXTERNAL_CONFIG')) { * By default it is automatically calculated but you can also set it as a fixed string to improve performances. */ define ('K_PATH_MAIN', $k_path_main); - + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Try to automatically set the value for the following K_PATH_URL constant. // NOTE: delete this section and manually set the K_PATH_URL constant below for better performances. @@ -117,7 +117,7 @@ if (!defined('K_TCPDF_EXTERNAL_CONFIG')) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Try to automatically set the value for the following K_PATH_IMAGES constant. // NOTE: delete this section and manually set the K_PATH_IMAGES constant below for better performances. - $tcpdf_images_dirs = array(K_PATH_MAIN.'examples/images/', '/usr/share/doc/tcpdf/', '/usr/share/doc/php-tcpdf/', '/usr/share/doc/php/tcpdf/', K_PATH_MAIN); + $tcpdf_images_dirs = array(K_PATH_MAIN.'examples/images/', '/usr/share/doc/tcpdf/examples/images/', '/usr/share/doc/php-tcpdf/examples/images/', '/usr/share/doc/php/tcpdf/examples/images/', '/var/www/tcpdf/images/', '/var/www/html/tcpdf/images/', '/usr/local/apache2/htdocs/tcpdf/images/', K_PATH_MAIN); foreach ($tcpdf_images_dirs as $tcpdf_images_path) { if (file_exists($tcpdf_images_path)) { break; @@ -127,6 +127,7 @@ if (!defined('K_TCPDF_EXTERNAL_CONFIG')) { /** * Default images directory. + * By default it is automatically set but you can also set it as a fixed string to improve performances. */ define ('K_PATH_IMAGES', $tcpdf_images_path); @@ -165,10 +166,20 @@ if (!defined('K_TCPDF_EXTERNAL_CONFIG')) { */ define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org"); + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Try to automatically set the value for the following K_PATH_IMAGES constant. + // NOTE: delete this section and manually set the K_PATH_IMAGES constant below for better performances. + $tcpdf_header_logo = ''; + if (file_exists(K_PATH_IMAGES.'tcpdf_logo.jpg')) { + $tcpdf_header_logo = 'tcpdf_logo.jpg'; + } + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + /** - * Image logo. + * Deafult image logo used be the default Header() method. + * Please set here your own logo or an empty string to disable it. */ - define ('PDF_HEADER_LOGO', 'tcpdf_logo.jpg'); + define ('PDF_HEADER_LOGO', $tcpdf_header_logo); /** * Header logo image width [mm]. diff --git a/examples/config/tcpdf_config_alt.php b/examples/config/tcpdf_config_alt.php index 36ddb46..01b797a 100644 --- a/examples/config/tcpdf_config_alt.php +++ b/examples/config/tcpdf_config_alt.php @@ -116,7 +116,7 @@ define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/'); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Try to automatically set the value for the following K_PATH_IMAGES constant. // NOTE: delete this section and manually set the K_PATH_IMAGES constant below for better performances. -$tcpdf_images_dirs = array(K_PATH_MAIN.'examples/images/', '/usr/share/doc/tcpdf/', '/usr/share/doc/php-tcpdf/', '/usr/share/doc/php/tcpdf/', K_PATH_MAIN); +$tcpdf_images_dirs = array(K_PATH_MAIN.'examples/images/', '/usr/share/doc/tcpdf/examples/images/', '/usr/share/doc/php-tcpdf/examples/images/', '/usr/share/doc/php/tcpdf/examples/images/', '/var/www/tcpdf/images/', '/var/www/html/tcpdf/images/', '/usr/local/apache2/htdocs/tcpdf/images/', K_PATH_MAIN); foreach ($tcpdf_images_dirs as $tcpdf_images_path) { if (file_exists($tcpdf_images_path)) { break; @@ -126,6 +126,7 @@ foreach ($tcpdf_images_dirs as $tcpdf_images_path) { /** * Default images directory. + * By default it is automatically set but you can also set it as a fixed string to improve performances. */ define ('K_PATH_IMAGES', $tcpdf_images_path); @@ -164,10 +165,20 @@ define ('PDF_HEADER_TITLE', 'TCPDF Example'); */ define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org"); +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// Try to automatically set the value for the following K_PATH_IMAGES constant. +// NOTE: delete this section and manually set the K_PATH_IMAGES constant below for better performances. +$tcpdf_header_logo = ''; +if (file_exists(K_PATH_IMAGES.'tcpdf_logo.jpg')) { + $tcpdf_header_logo = 'tcpdf_logo.jpg'; +} +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + /** - * Image logo. + * Deafult image logo used be the default Header() method. + * Please set here your own logo or an empty string to disable it. */ -define ('PDF_HEADER_LOGO', 'tcpdf_logo.jpg'); +define ('PDF_HEADER_LOGO', $tcpdf_header_logo); /** * Header logo image width [mm].