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

(07-07-2022, 07:17 AM)Erwin Wrote: Hi,
I'm using tcpdf 6.4.1 with Codeigniter 4. It works without any problems.
There are a few changes in the configuration that I need:
For example, I have changed the definition for PDF_MARGIN_TOP in vendor/tecnickom/tcpdf/config.
I would prefer to leave the vendor directory untouched and keep those changes inside my /app directory. Any ideas how this can be done?

I do not use the library directly, but will try to help you.

When you start using the tcpdf library, you initiate a new tcpdf object:

PHP Code:

and then you can manipulate it's properties through the TCPDF class methods.

The property you refer to is defined in the config file as a constant:

PHP Code:
define ('PDF_MARGIN_TOP'27); 

But as described in the documentation, you can change it through the TCPDF method SetMargins:

PHP Code:

Instead of using the defaults (as in the example line above) you can use your own numbers - all or part of them:

PHP Code:

Donatas G.

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