Changeset 17131
- Timestamp:
- 04/08/09 12:32:51 (4 years ago)
- Files:
-
- plugins/sfTCPDFPlugin/branches/1.2/README (modified) (1 diff)
- plugins/sfTCPDFPlugin/branches/1.2/config/config.php (added)
- plugins/sfTCPDFPlugin/branches/1.2/config/config.php.old (deleted)
- plugins/sfTCPDFPlugin/branches/1.2/config/pdf_configs.yml (modified) (1 diff)
- plugins/sfTCPDFPlugin/branches/1.2/config/routing.yml (added)
- plugins/sfTCPDFPlugin/branches/1.2/lib (modified) (1 prop)
- plugins/sfTCPDFPlugin/branches/1.2/lib/sfTCPDF.class.php (added)
- plugins/sfTCPDFPlugin/branches/1.2/lib/sfTCPDFPluginConfigHandler.class.php (modified) (4 diffs)
- plugins/sfTCPDFPlugin/branches/1.2/modules/sfTCPDF/lib/BasesfTCPDFActions.class.php (modified) (7 diffs)
- plugins/sfTCPDFPlugin/branches/1.2/web/images/_blank.png (added)
- plugins/sfTCPDFPlugin/branches/1.2/web/images/logo_example.png (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfTCPDFPlugin/branches/1.2/README
r17104 r17131 1 = sfTCPDFPlugin = 1 sfTCPDFPlugin 2 ------------- 2 3 3 `sfTCPDFPlugin` class provides abstraction for the [http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf TCPDF library].4 **sfTCPDFPlugin** class provides abstraction for the [TCPDF library](http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf). 4 5 The main interest of this FPDF extension resides in the fact that it handles any UTF8 strings. 5 6 6 == Installation == 7 Installation 8 ============ 7 9 8 * Install the plugin10 * Install the plugin 9 11 10 {{{ 11 symfony plugin-install http://plugins.symfony-project.com/sfTCPDFPlugin 12 }}} 12 $ symfony plugin:install sfTCPDFPlugin 13 13 14 or download it and unzip in your /plugins directory14 (or download it and unzip in your /plugins directory) 15 15 16 * Download the [http://sourceforge.net/project/showfiles.php?group_id=128076 TCPDF library]16 * Download the [TCPDF library](http://sourceforge.net/project/showfiles.php?group_id=128076&package_id=140403) 17 17 18 * Unzip it inside the '''/plugins/sfTCPDFplugin/lib''' folder 18 * Unzip it inside the `/plugins/sfTCPDFplugin/lib` folder, at this point, you 19 should have a `tcpdf` folder in `/plugins/sfTCPDFPlugin/lib` 19 20 20 At this point, you should have a '''tcpdf''' folder in '''/plugins/sfTCPDFPlugin/lib''' 21 * Publish the assets of the plugin (this is only usefull if you want to test the demos included in the plugin) 22 23 $ symfony plugin:publish-assets 24 25 * Clear you cache 21 26 22 * Copy the files in '''/web/sfTCPDFPlugin''' directly to your application '''/web''' directory27 $ symfony cc 23 28 24 * Clear you cache 29 Configuration 30 ============= 25 31 26 {{{27 symfony cc28 }}}32 * Set '''sf_tcpdf_dir''' in your '''config.php''' application if TCPDF library 33 is not inside the '''/plugins/sfTCPDFplugin/lib''' folder 34 (check '''/plugins/sfTCPDFPlugin/config/config.php''') 29 35 30 == Configuration == 36 * If you want to have custom settings for each generated PDF 37 check '''/plugins/sfTCPDFPlugin/config/config.php''' and '''tcpdf/config/tcpdf_config.php'''). 31 38 32 * Set '''sf_tcpdf_dir''' in your '''config.php''' application if TCPDF library is not inside the '''/plugins/sfTCPDFplugin/lib''' folder (check '''/plugins/sfTCPDFPlugin/config/config.php''') 39 * If you want to run the tests, enable the '''sfTCPDF''' module in your 40 `settings.yml` file, then call `sfTCPDF/test` or `sfTCPDF/test2` 33 41 34 * If you want to have custom settings for each generated PDF check '''/plugins/sfTCPDFPlugin/config/config.php''' and '''tcpdf/config/tcpdf_config.php'''). 42 Usage 43 ===== 35 44 36 * If you want to run the tests, enable the '''sfTCPDF''' module in your '''settings.yml''' file, then call '''sfTCPDF/test''' or '''sfTCPDF/test2'''45 * 1 - Hello World test (sfTCPDF/test) 37 46 38 == Usage == 47 * 2 - Full test (sfTCPDF/test2, check '''/plugins/sfTCPDFPlugin/actions/actions.php''') 39 48 40 * 1 - Hello World test (sfTCPDF/test) 49 Demo 50 ==== 41 51 42 {{{ 43 /** 44 * Hello world test 45 */ 46 public function executeTest() 47 { 48 // pdf object 49 $pdf = new sfTCPDF(); 52 * You can find the [http://snippets.coilblog.com/sfTCPDF/test hello world] and the [http://snippets.coilblog.com/sfTCPDF/test2 full test] on my blog. 50 53 51 // settings 52 $pdf->SetFont("FreeSerif", "", 12); 53 $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); 54 $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); 55 $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING); 56 $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); 57 $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); 58 $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); 54 Notes 55 ===== 59 56 60 // init pdf doc 61 $pdf->AliasNbPages(); 62 $pdf->AddPage(); 63 $pdf->Cell(80, 10, "Hello World !!! & é € U û いろは"); 57 * I seems there are problems with the TCPDF class when using PHP 5.1.x 64 58 65 // output 66 $pdf->Output(); 67 return sfView::NONE; 68 } 69 }}} 59 TODO 60 ==== 70 61 71 * 2 - Full test (sfTCPDF/test2, check '''/plugins/sfTCPDFPlugin/actions/actions.php''')62 * symfony 1.2 version of plugin 72 63 73 == Changelog == 64 Support 65 ======= 74 66 75 === 1.5.3 === 67 * Please report bugs on the symfony TRAC 68 * Feeback on the symfony users mailing list 76 69 70 See you. COil :) 71 72 Changelog 73 ========= 74 75 [note] 76 Check the changelog TAB to see changelogs of >= 1.6.0 versions 77 78 * 1.5.3 77 79 * Initial version for TCPDF 1.53 TC030 78 80 79 === 2007-06-04 | 1.5.4 Stable === 80 81 * 2007-06-04 | 1.5.4 Stable 81 82 * Fix Full test (sfTCPDF/test2) 82 83 * Customize Plugin is now possible 83 84 84 === 2008-01-21 | 1.5.5 Stable === 85 * 2008-01-21 | 1.5.5 Stable 85 86 * Change the constant FPDF_FONTPATH to K_PATH_FONTS for work with the last version of TCPDF (Garfield-fr) 86 87 == Demo ==88 89 * You can find the [http://snippets.coilblog.com/sfTCPDF/test hello world] and the [http://snippets.coilblog.com/sfTCPDF/test2 full test] on my blog.90 91 == Notes ==92 93 * I seems there are problems with the TCPDF class when using PHP 5.1.x94 * I am searching beta testers to get some feeback. (C0il on IRC on, comment on my blog or whatever you want !)95 96 === TODO ===97 98 === Plugin support ===99 100 * Please report bugs/feeback in the [http://www.symfony-project.com/forum/index.php/f/12/ plugin section] of the forum101 * You can find also contact me on IRC or by email (check README file)102 103 COil :)plugins/sfTCPDFPlugin/branches/1.2/config/pdf_configs.yml
r17108 r17131 1 config1: 2 K_PATH_MAIN: kiokoko 3 K_PATH_URL: dff 4 K_PATH_FONTS: fdsf 5 K_PATH_CACHE: sdfsd 6 K_PATH_URL_CACHE: fsdfsd 7 K_PATH_IMAGES: gdfg 8 K_BLANK_IMAGE: dgdfgdf 1 # Main config 2 default: 3 # Be carefull the order of these configuration keys should not be modified. 4 # More more informations about these parameters check the TCPDF documentation 9 5 10 # Other configs 6 # Disable default TCPDF default config 7 K_TCPDF_EXTERNAL_CONFIG: true 8 9 # Auto-detected parameters (leave empty for auto-detection) ################## 10 # Installation path (/var/www/tcpdf/) 11 K_PATH_MAIN: 12 K_PATH_URL: 13 K_PATH_FONTS: 14 K_PATH_CACHE: 15 K_PATH_URL_CACHE: 16 K_PATH_IMAGES: 17 K_BLANK_IMAGE: 11 18 12 config2: 13 # ... 19 # Other parameters ########################################################## 20 # page format 21 PDF_PAGE_FORMAT: "A4" 22 # page orientation (P=portrait, L=landscape) 23 PDF_PAGE_ORIENTATION: "P" 24 # document creator 25 PDF_CREATOR: "TCPDF" 26 # document author 27 PDF_AUTHOR: "TCPDF" 28 # header title 29 PDF_HEADER_TITLE: "TCPDF Example" 30 # header description string 31 PDF_HEADER_STRING: "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org - symfony plugin by Vernet Loïc (Aka COil) - http://www.symfony-project.org/plugins/sfTCPDFPlugin" 32 # image logo 33 PDF_HEADER_LOGO: "tcpdf_logo.jpg" 34 # header logo image width [mm] 35 PDF_HEADER_LOGO_WIDTH: 30 36 # document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch] 37 PDF_UNIT: "mm" 38 # header margin 39 PDF_MARGIN_HEADER: "5" 40 # footer margin 41 PDF_MARGIN_FOOTER: "10" 42 # top margin 43 PDF_MARGIN_TOP: "27" 44 # bottom margin 45 PDF_MARGIN_BOTTOM: "25" 46 # left margin 47 PDF_MARGIN_LEFT: "15" 48 # right margin 49 PDF_MARGIN_RIGHT: "15" 50 # default main font name 51 PDF_FONT_NAME_MAIN: "helvetica" 52 # default main font size 53 PDF_FONT_SIZE_MAIN: "10" 54 # default data font name 55 PDF_FONT_NAME_DATA: "helvetica" 56 # default data font size 57 PDF_FONT_SIZE_DATA: "8" 58 # default monospaced font name 59 PDF_FONT_MONOSPACED: "courier" 60 # Ratio used to scale the images 61 PDF_IMAGE_SCALE_RATIO: "4" 62 # magnification factor for titles 63 HEAD_MAGNIFICATION: "1.1" 64 # height of cell repect font height 65 K_CELL_HEIGHT_RATIO: "1.25" 66 # title magnification respect main font size 67 K_TITLE_MAGNIFICATION: "1.3" 68 # reduction factor for small font 69 K_SMALL_RATIO: "2/3" 70 71 # Specific configs (copy this file in your application config directory to ovveride it) 72 my_config: 73 K_TCPDF_EXTERNAL_CONFIG: true 74 K_PATH_MAIN: /var/www/my-symfony-project/plugins/sfTCPDFPlugin/tcpdf/ 75 K_PATH_URL: http://dev.my-symfony-project/ 76 K_PATH_FONTS: /var/www/my-symfony-project/plugins/sfTCPDFPlugin/tcpdf/fonts 77 K_PATH_CACHE: /var/www/my-symfony-project/plugins/sfTCPDFPlugin/tcpdf/cache 78 K_PATH_URL_CACHE: http://dev.my-symfony-project/cache 79 K_PATH_IMAGES: /var/www/my-symfony-project/plugins/sfTCPDFPlugin/tcpdf/images 80 K_BLANK_IMAGE: /var/www/my-symfony-project/plugins/sfTCPDFPlugin/tcpdf/images/_blank.png 81 82 # ... copy paste from defaulf config. plugins/sfTCPDFPlugin/branches/1.2/lib
- Property svn:ignore set to
tcpdf
- Property svn:ignore set to
plugins/sfTCPDFPlugin/branches/1.2/lib/sfTCPDFPluginConfigHandler.class.php
r17108 r17131 29 29 public function execute($configFiles) 30 30 { 31 $config = self:: getConfiguration($configFiles);31 $config = self::parseYamls($configFiles); 32 32 33 33 // compile data … … 40 40 41 41 $retval = sprintf($retval, __CLASS__, date('Y/m/d H:i:s'), var_export($config, true)); 42 42 43 43 return $retval; 44 44 } 45 46 /**47 * Get the plugin configuration.48 *49 * @see sfConfigHandler50 */51 static public function getConfiguration(array $configFiles)52 {53 return self::parseYamls($configFiles);54 }55 45 56 46 /** … … 60 50 * @since 6 august 08 61 51 */ 62 public static function load( )52 public static function load($config_key) 63 53 { 64 54 $config = sfConfig::get(self::$namespace); … … 66 56 if (!$config) 67 57 { 68 $config = self::checkAndGet ();58 $config = self::checkAndGetConfig($config_key); 69 59 sfConfig::set(self::$namespace, $config); 70 60 } 61 62 return $config; 63 } 64 65 /** 66 * Generate the config file if not present and return a configuration for 67 * a given key or return the default configuration. 68 * 69 * @author COil 70 * @since V1.6.0 - 7 apr 09 71 * 72 * @param $config String Config key 73 * 74 * @return Array 75 */ 76 public static function checkAndGetConfig($config = null) 77 { 78 $configs = include(sfContext::getInstance()->getConfigCache()->checkConfig(self::$config_file_pattern)); 79 80 return $config && isset($configs[$config]) ? $configs[$config] : $configs['default']; 81 } 82 83 /** 84 * Create all TCPDF specific constants. 85 * 86 * @author COil 87 * @since V1.6.0 - 7 apr 09 88 * 89 * @return Array 90 */ 91 public static function applyTCPDFConfig($config) 92 { 93 if (!sfConfig::get('sfTCPDFPlugin_dir')) 94 { 95 sfConfig::set('sfTCPDFPlugin_dir', sfConfig::get('sf_root_dir'). DIRECTORY_SEPARATOR. 'plugins'. DIRECTORY_SEPARATOR. 'sfTCPDFPlugin'. DIRECTORY_SEPARATOR. 'lib'. DIRECTORY_SEPARATOR. 'tcpdf'. DIRECTORY_SEPARATOR); 96 } 97 98 foreach ($config as $key => $value) 99 { 100 switch ($key) 101 { 102 case 'K_TCPDF_EXTERNAL_CONFIG': 103 if ($value) 104 { 105 define('K_TCPDF_EXTERNAL_CONFIG', true); 106 } 107 break; 108 109 case 'K_PATH_MAIN': 110 if (empty($value)) 111 { 112 $value = sfConfig::get('sfTCPDFPlugin_dir'); 113 } 114 115 define('K_PATH_MAIN', $value); 116 break; 117 118 case 'K_PATH_URL': 119 if (empty($value) && sfContext::hasInstance()) 120 { 121 $request = sfContext::getInstance()->getRequest(); 122 $value = $request->getUriPrefix(). '/'; 123 } 124 125 define('K_PATH_URL', $value); 126 break; 127 128 case 'K_PATH_FONTS': 129 if (empty($value)) 130 { 131 $value = K_PATH_MAIN.'fonts/'; 132 } 133 134 define ('K_PATH_FONTS', $value); 135 break; 136 137 case 'K_PATH_CACHE': 138 if (empty($value)) 139 { 140 $value = K_PATH_MAIN.'cache/'; 141 } 142 143 define ('K_PATH_CACHE', $value); 144 break; 145 146 case 'K_PATH_URL_CACHE': 147 if (empty($value)) 148 { 149 $value = K_PATH_URL. 'cache/'; 150 } 151 152 define ('K_PATH_URL_CACHE', $value); 153 break; 154 155 case 'K_PATH_IMAGES': 156 if (empty($value)) 157 { 158 $value = K_PATH_MAIN. 'images/'; 159 } 160 161 define ('K_PATH_IMAGES', $value); 162 break; 163 164 case 'K_BLANK_IMAGE': 165 if (empty($value)) 166 { 167 $value = K_PATH_MAIN. 'images/'; 168 } 169 170 define ('K_BLANK_IMAGE', K_PATH_IMAGES.'_blank.png'); 171 break; 172 173 default: 174 175 // Only define a constant if it's TCPDF known constant 176 if (in_array($key, self::getTCPDFConstantsList())) 177 { 178 define ($key, $value); 179 } 180 181 break; 182 } 183 } 184 } 185 186 /** 187 * Retrieve and load a TCPDF configuration. 188 * 189 * @param $config String Name of config to load ("default" by default) 190 */ 191 public static function loadConfig($config_key = null) 192 { 193 $config = self::checkAndGetConfig($config_key); 194 self::applyTCPDFConfig($config); 195 sfConfig::set(self::$namespace, $config); 71 196 72 197 return $config; 73 198 } 74 75 /** 76 * Generate the config file if not present and return it. 77 * 78 * @author COil 79 * @since V1.6.0 - 7 apr 09 80 * 81 * @return Array 82 */ 83 public static function checkAndGet() 84 { 85 $config = include(sfContext::getInstance()->getConfigCache()->checkConfig(self::$config_file_pattern)); 86 87 return $config; 88 } 89 90 /** 91 * Return all the configuration structure. 92 * 93 * @author COil 94 * @since V1.6.0 - 7 apr 09 95 * 96 * @return Array 97 */ 98 public static function getAll() 99 { 100 return self::load(); 199 200 /** 201 * Include a TCPDF language file, if the language file the culture is not founf 202 * then the defaut language is included (en) 203 * 204 * @param $culture Language to inlcude 205 */ 206 public static function includeLangFile($culture) 207 { 208 // Supported langs by TCPDF 209 $culture_to_lang_file = array( 210 'en' => 'eng', 211 'it' => 'ita' 212 ); 213 214 $lang_file = in_array($culture, array_keys($culture_to_lang_file)) 215 ? $culture_to_lang_file[$culture] 216 : $culture_to_lang_file['en'] 217 ; 218 219 require_once(K_PATH_MAIN. 'config/lang/'. $lang_file. '.php'); 220 } 221 222 /** 223 * Retrieve the list of know TCPDF constant. 224 * 225 * @return Array 226 */ 227 public static function getTCPDFConstantsList() 228 { 229 return array( 230 'K_TCPDF_EXTERNAL_CONFIG', 231 'K_PATH_MAIN', 232 'K_PATH_URL', 233 'K_PATH_FONTS', 234 'K_PATH_CACHE', 235 'K_PATH_URL_CACHE', 236 'K_PATH_IMAGES', 237 'K_BLANK_IMAGE', 238 'PDF_PAGE_FORMAT', 239 'PDF_PAGE_ORIENTATION', 240 'PDF_CREATOR', 241 'PDF_AUTHOR', 242 'PDF_HEADER_TITLE', 243 'PDF_HEADER_STRING', 244 'PDF_HEADER_LOGO', 245 'PDF_HEADER_LOGO_WIDTH', 246 'PDF_UNIT', 247 'PDF_MARGIN_HEADER', 248 'PDF_MARGIN_FOOTER', 249 'PDF_MARGIN_TOP', 250 'PDF_MARGIN_BOTTOM', 251 'PDF_MARGIN_LEFT', 252 'PDF_MARGIN_RIGHT', 253 'PDF_FONT_NAME_MAIN', 254 'PDF_FONT_SIZE_MAIN', 255 'PDF_FONT_NAME_DATA', 256 'PDF_FONT_SIZE_DATA', 257 'PDF_FONT_MONOSPACED', 258 'PDF_IMAGE_SCALE_RATIO', 259 'HEAD_MAGNIFICATION', 260 'K_CELL_HEIGHT_RATIO', 261 'K_TITLE_MAGNIFICATION', 262 'K_SMALL_RATIO' 263 ); 101 264 } 102 265 } plugins/sfTCPDFPlugin/branches/1.2/modules/sfTCPDF/lib/BasesfTCPDFActions.class.php
r17108 r17131 2 2 3 3 /** 4 * base sfTCPDF actions.4 * Base sfTCPDF actions for demos. 5 5 * 6 6 * @package sfTCPDFPlugin 7 7 * @author Vernet Loïc aka COil <qrf_coil@yahoo.fr> 8 * @since 1 6 march 20078 * @since 1.6.0 - 16 march 2007 9 9 */ 10 10 11 11 class BasesfTCPDFActions extends sfActions 12 12 { 13 14 13 /** 15 * Hello world test 14 * Hello world test. 16 15 */ 17 16 public function executeTest() 18 17 { 18 $config = sfTCPDFPluginConfigHandler::loadConfig(); 19 20 //mzTools::dump($config, '$config', true); 21 19 22 // pdf object 20 23 $pdf = new sfTCPDF(); … … 40 43 41 44 /** 42 * Full test 45 * Full test. 43 46 * 44 47 * It's the test that is bundled in /tcpdf/test_unicode.php … … 46 49 public function executeTest2() 47 50 { 51 $config = sfTCPDFPluginConfigHandler::loadConfig(); 52 sfTCPDFPluginConfigHandler::includeLangFile($this->getUser()->getCulture()); 48 53 49 require_once(sfConfig::get('sf_tcpdf_dir').'/config/lang/eng.php'); 50 51 $doc_title = "test title"; 52 $doc_subject = "test description"; 54 $doc_title = "test title"; 55 $doc_subject = "test description"; 53 56 $doc_keywords = "test keywords"; 54 $htmlcontent = "< € € € & è è © ><br /><h1>heading 1</h1><h2>heading 2</h2><h3>heading 3</h3><h4>heading 4</h4><h5>heading 5</h5><h6>heading 6</h6>ordered list:<br /><ol><li><b>bold text</b></li><li><i>italic text</i></li><li><u>underlined text</u></li><li><a href=\"http://www.tecnick.com\">link to http://www.tecnick.com</a></li><li>test break<br />second line<br />third line</li><li><font size=\"+3\">font + 3</font></li><li><small>small text</small></li><li>normal <sub>subscript</sub> <sup>superscript</sup></li></ul><hr />table:<br /><table border=\"1\" cellspacing=\"1\" cellpadding=\"1\"><tr><th>#</th><th>A</th><th>B</th></tr><tr><th>1</th><td bgcolor=\"#cccccc\">A1</td><td>B1</td></tr><tr><th>2</th><td>A2 € € € & è è </td><td>B2</td></tr><tr><th>3</th><td>A3</td><td><font color=\"#FF0000\">B3</font></td></tr></table><hr />image:<br /><img src=\"sfTCPDFPlugin/images/logo_example.png\" alt=\"test alt attribute\" width=\"100\" height=\"100\" border=\"0\" />";57 $htmlcontent = "< € € € & è è © ><br /><h1>heading 1</h1><h2>heading 2</h2><h3>heading 3</h3><h4>heading 4</h4><h5>heading 5</h5><h6>heading 6</h6>ordered list:<br /><ol><li><b>bold text</b></li><li><i>italic text</i></li><li><u>underlined text</u></li><li><a href=\"http://www.tecnick.com\">link to http://www.tecnick.com</a></li><li>test break<br />second line<br />third line</li><li><font size=\"+3\">font + 3</font></li><li><small>small text</small></li><li>normal <sub>subscript</sub> <sup>superscript</sup></li></ul><hr />table:<br /><table border=\"1\" cellspacing=\"1\" cellpadding=\"1\"><tr><th>#</th><th>A</th><th>B</th></tr><tr><th>1</th><td bgcolor=\"#cccccc\">A1</td><td>B1</td></tr><tr><th>2</th><td>A2 € € € & è è </td><td>B2</td></tr><tr><th>3</th><td>A3</td><td><font color=\"#FF0000\">B3</font></td></tr></table><hr />image:<br /><img src=\"sfTCPDFPlugin/images/logo_example.png\" alt=\"test alt attribute\" width=\"100\" height=\"100\" border=\"0\" />"; 55 58 56 59 //create new PDF document (document units are set by default to millimeters) … … 68 71 //set margins 69 72 $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); 73 70 74 //set auto page breaks 71 75 $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); … … 81 85 //initialize document 82 86 $pdf->AliasNbPages(); 83 84 87 $pdf->AddPage(); 85 88 … … 103 106 $pdf->SetFont("FreeSerif", "", 12); 104 107 105 $utf8text = file_get_contents( sfConfig::get('sf_tcpdf_dir'). "utf8test.txt", false); // get utf-8 text form file108 $utf8text = file_get_contents(K_PATH_CACHE. "utf8test.txt", false); // get utf-8 text form file 106 109 $pdf->SetFillColor(230, 240, 255, true); 107 110 $pdf->Write(5,$utf8text, '', 1); … … 145 148 146 149 return sfView::NONE; 147 148 150 } 149 151 }