Welcome Guest, Not a member yet? Register   Sign In
TCPDF Problem
#1

[eluser]eric cumbee[/eluser]
I am using a Combo of GD and TCPDF using the Connector found in the wiki. everything was alot easier than i thought it would be.
the only problem i am running into is i am getting these two errors.
Code:
Severity: Notice

Message: Use of undefined constant K_CELL_HEIGHT_RATIO - assumed 'K_CELL_HEIGHT_RATIO'

Filename: libraries/Loader.php

Line Number: 928

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /nfs/c05/h03/mnt/74925/domains/registration.connectroots.net/ci/libraries/Exceptions.php:166)

Filename: tcpdf/tcpdf.php

Line Number: 5361
I know that the second error is a product of the first error being popped. if i inhibit error reporting using
Code:
error_reporting(0);
it works fine, however i really want to address the underlying problem and not just put a bandaid on it for lack of better words.

anyone else run into this?
#2

[eluser]eric cumbee[/eluser]
Bump anybody?
#3

[eluser]tecrik[/eluser]
Same problem here. Anyone?
#4

[eluser]bgreene[/eluser]
works fine for me. K_CELL_HEIGHT_RATIO is defined in tcpdf_config.php. maybe you have an error in tcpdf.php
line 132
/**
* main configuration file
*/
require_once(dirname(__FILE__).'/config/tcpdf_config.php');

my dir setup is
..plugins/
....tcpdf/
......tcpdf.php
......config/
........tcpdf_config.php
#5

[eluser]Unknown[/eluser]
Add ob_clean(); right before your $this->pdf->Output(...)
#6

[eluser]tecrik[/eluser]
Didn't really work for me, just adds another error message telling me that there is no buffer to empty. I am starting to think that I has got something to do with the way I integrated TCPDF into CI. I followed those instructions:

http://codeigniter.com/wiki/TCPDF-CodeIg...tegration/

Are those correct, did anybody else use them as well?

Also, I am now getting this message as well:

Code:
Fatal error: Cannot access private property Pdf::$cfg_constant_map in /var/www/vhosts/domain.com/httpdocs/admin/system/application/3rdparty/tcpdf/tcpdf.php on line 5466
#7

[eluser]Anders1975[/eluser]
I've seen this problem too, and I adjusted the tcpdf.php file around line 948 (version 4.6.013):

Code:
protected $cell_height_ratio = 1.25; //K_CELL_HEIGHT_RATIO;

So I just hardcoded the value 1.25 - got the value from tcpdf_config.php.
#8

[eluser]fjhuerte[/eluser]
I have encountered the same problem..
i followed AndoAttack's advice and it worked like a charm!
Thanks!=)
#9

[eluser]tecrik[/eluser]
Yeah, awesome, it worked for me as well. All I am stuck with now is a double fatal error:

Fatal error: Cannot access private property Pdf::$cfg_constant_map in /var/www/vhosts/domain.com/httpdocs/admin/system/application/3rdparty/tcpdf/tcpdf.php on line 5466

Any ideas about that one?
#10

[eluser]Unknown[/eluser]
[quote author="tecrik" date="1259165556"]Yeah, awesome, it worked for me as well. All I am stuck with now is a double fatal error:

Fatal error: Cannot access private property Pdf::$cfg_constant_map in /var/www/vhosts/domain.com/httpdocs/admin/system/application/3rdparty/tcpdf/tcpdf.php on line 5466

Any ideas about that one?[/quote]

The only way I've been able to get around this is to change the $cfg_constant_map visibility from private to protected in libraries/pdf.php near line 31:

Code:
protected $config_constant_map = array(

Once this is changed, a similar error was displayed for $_config, so I did the same thing for it (near line 48 in libraries/pdf.php)

Code:
protected $_config = array();

After these two changes, the pdf displayed properly for me. YMMV.




Theme © iAndrew 2016 - Forum software by © MyBB