Welcome Guest, Not a member yet? Register   Sign In
tcpdf configuration

(07-28-2022, 12:59 PM)dgvirtual Wrote:
(07-11-2022, 12:07 PM)Erwin Wrote: Hi,
thanks for your answer. This works with definitions that aren't used in the TCPDF class. In my case, I want to set K_TCPDF_CALLS_IN_HTML to true to be able to use the tcpdf  tag in HTML.
Mhm, if you look at the code of tcpdf, https://github.com/tecnickcom/TCPDF/blob...php#L19484 , you see that the variable you want to set is a global that is not automatically expected to be set, so you might try to set it yourself using

define("K_TCPDF_CALLS_IN_HTML", true)

Have you tried it? It should be done before the library is initiated (before the $pdf = new...) so that when the lib config is read, it finds the global variable set and does not create it anew (see the config file on how it is set: https://github.com/tecnickcom/TCPDF/blob...g.php#L227 )

I think I have found a nice solution now:

I have copied tcpdf_config.php to app/Config/, and added define('K_TCPDF_EXTERNAL_CONFIG', true); at the beginning.
Then, I added this new config file in composer.json:
"autoload": {
    "files": [

Finally, I did a "composer dump-autoload" to update the autoloader.
All configuration changes can be done in app/Config/tcpdf_config.php now.

Messages In This Thread
tcpdf configuration - by Erwin - 07-07-2022, 07:17 AM
RE: tcpdf configuration - by dgvirtual - 07-11-2022, 08:42 AM
RE: tcpdf configuration - by Erwin - 07-11-2022, 12:07 PM
RE: tcpdf configuration - by dgvirtual - 07-28-2022, 12:59 PM
RE: tcpdf configuration - by Erwin - 08-04-2022, 03:14 PM

Theme © iAndrew 2016 - Forum software by © MyBB