Search code examples
phpcodeignitertcpdfdirectory-structure

TCPDF Font Directory error, wrong directory separators


Hi i'm just integrated CodeIgniter with PHPWord seamlessly and working with no problem, but at the moment to integrate TCPDF gives me an error like this:

A PHP Error was encountered

Severity: Warning

Message: opendir(C:\wamp\www\Dropbox\PTC\application\third_party\tcpdf/fonts/,C:\wamp\www\Dropbox\PTC\application\third_party\tcpdf/fonts/): El sistema no puede encontrar el archivo especificado.(Translated: The system can not find the file specified .) (code: 2)

Filename: tcpdf/tcpdf.php

Line Number: 4154

The first thing i saw is the wrong directory separators (some PHP libraries has the same issue when is used in non-UNIX enviroments as Windows, using hardcoded directory separators).

I've modified the php files with the PHP constant: DIRECTORY SEPARATOR but with no luck. Some advice?


Solution

  • There are various paths you can/must set in the TCPDF config file ./config/tcpdf_config.php.

    For example, there's a K_PATH_FONTS constant which sets the path to the fonts, maybe you also need/want to set K_PATH_MAIN.