is there any setting to declare the member variables in constructor?
is there any setting to declare the member variables in constructor?
am 27.03.2010 17:50:21 von solo hsi
now i'm re-writing some script to output pdf files. the original code
is based on fpdf, but as you know, fpdf can't deal with the characters
in utf8. so i want to change it to tcpdf. there is a class extend from
fpdf, in its constructor function, there is some script just like
"$this->db = $db;". there isn't any variable named "$db" in parent
class(class fpdf) and child class, i have checked it carefully and
"print_r($this)" at the top of child's constructor function. but after
"$this->db=$db", there is a member variable named $db(i have print_r
and check it too). when i change the parent class to tcpdf, although i
haven't change any code in child class and there isn't a member
variable named $db in parent class(class tcpdf), php returns me a
error "TCPDF ERROR: Cannot access protected property / Undefined
property". i print_r($this) at the top of constructor function again
and check whether there is a member variable named $db in both parent
and child class, finally i'm sure there isn't. i think maybe there is
a setting in the parent class(fpdf/tcpdf) here about this condition.
it controls whether you can declare a member variable by equaling it.
i tried to find it out on google or in fpdf/tcpdf sources but i
failed, there are about 16k lines in tcpdf.... so i post this mail to
request some help, is there somebody have any experience about this
case? please help me, thanks a lot.
solo
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: is there any setting to declare the member variables in
am 29.03.2010 14:14:08 von Richard Quadling
On 27 March 2010 17:50, solo hsi wrote:
> now i'm re-writing some script to output pdf files. the original code
> is based on fpdf, but as you know, fpdf can't deal with the characters
> in utf8.
From http://www.fpdf.org/?lang=en
"What languages can I use?
The class can produce documents in many languages other than the
Western European ones: Central European, Cyrillic, Greek, Baltic and
Thai, provided you own TrueType or Type1 fonts with the desired
character set. Chinese, Japanese and Korean are supported too."
So, if you have the font for it, you should be able to encode the data
easily enough. No matter what encoding you are using, unless the font
you want to use has a glyph for it, you can't use it. This is more
often the problem I've found.
Regards,
Richard.
--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: is there any setting to declare the member variables in
am 29.03.2010 17:47:02 von solo hsi
sure, i know fpdf can deal with asian character like Chinese, but it
can't work with utf-8 charactor so that i have to replace it with
tcpdf.
On Mon, Mar 29, 2010 at 8:14 PM, Richard Quadling
wrote:
> On 27 March 2010 17:50, solo hsi wrote:
>> now i'm re-writing some script to output pdf files. the original code
>> is based on fpdf, but as you know, fpdf can't deal with the characters
>> in utf8.
>
> From http://www.fpdf.org/?lang=en
>
> "What languages can I use?
>
> The class can produce documents in many languages other than the
> Western European ones: Central European, Cyrillic, Greek, Baltic and
> Thai, provided you own TrueType or Type1 fonts with the desired
> character set. Chinese, Japanese and Korean are supported too."
>
> So, if you have the font for it, you should be able to encode the data
> easily enough. No matter what encoding you are using, unless the font
> you want to use has a glyph for it, you can't use it. This is more
> often the problem I've found.
>
> Regards,
>
> Richard.
> --
> -----
> Richard Quadling
> "Standing on the shoulders of some very clever giants!"
> EE : http://www.experts-exchange.com/M_248814.html
> EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
> ZOPA : http://uk.zopa.com/member/RQuadling
>
--
solo(xzyyyy@gmail.com)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: is there any setting to declare the member variables in
am 29.03.2010 18:12:56 von Richard Quadling
On 29 March 2010 16:47, solo hsi wrote:
> sure, i know fpdf can deal with asian character like Chinese, but it
> can't work with utf-8 charactor so that i have to replace it with
> tcpdf.
>
> On Mon, Mar 29, 2010 at 8:14 PM, Richard Quadling
> wrote:
>> On 27 March 2010 17:50, solo hsi wrote:
>>> now i'm re-writing some script to output pdf files. the original code
>>> is based on fpdf, but as you know, fpdf can't deal with the characters
>>> in utf8.
>>
>> From http://www.fpdf.org/?lang=en
>>
>> "What languages can I use?
>>
>> The class can produce documents in many languages other than the
>> Western European ones: Central European, Cyrillic, Greek, Baltic and
>> Thai, provided you own TrueType or Type1 fonts with the desired
>> character set. Chinese, Japanese and Korean are supported too."
>>
>> So, if you have the font for it, you should be able to encode the data
>> easily enough. No matter what encoding you are using, unless the font
>> you want to use has a glyph for it, you can't use it. This is more
>> often the problem I've found.
>>
>> Regards,
>>
>> Richard.
>> --
>> -----
>> Richard Quadling
>> "Standing on the shoulders of some very clever giants!"
>> EE : http://www.experts-exchange.com/M_248814.html
>> EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
>> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
>> ZOPA : http://uk.zopa.com/member/RQuadling
>>
>
>
>
> --
> solo(xzyyyy@gmail.com)
>
Aha! I see what you mean.
http://www.fpdf.org/en/tutorial/tuto7.htm
Uses an encoding and only allows 256 characters.
Hmm.
With regard to your issue, it sounds like the class is extended
further or uses magic functions to set/get missing properties.
--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: is there any setting to declare the member variables in
am 29.03.2010 18:47:12 von solo hsi
i have done my work, replaced fpdf with tcpdf, just by using fpdi:)
On Tue, Mar 30, 2010 at 12:12 AM, Richard Quadling
wrote:
> On 29 March 2010 16:47, solo hsi wrote:
>> sure, i know fpdf can deal with asian character like Chinese, but it
>> can't work with utf-8 charactor so that i have to replace it with
>> tcpdf.
>>
>> On Mon, Mar 29, 2010 at 8:14 PM, Richard Quadling
>> wrote:
>>> On 27 March 2010 17:50, solo hsi wrote:
>>>> now i'm re-writing some script to output pdf files. the original code
>>>> is based on fpdf, but as you know, fpdf can't deal with the characters
>>>> in utf8.
>>>
>>> From http://www.fpdf.org/?lang=en
>>>
>>> "What languages can I use?
>>>
>>> The class can produce documents in many languages other than the
>>> Western European ones: Central European, Cyrillic, Greek, Baltic and
>>> Thai, provided you own TrueType or Type1 fonts with the desired
>>> character set. Chinese, Japanese and Korean are supported too."
>>>
>>> So, if you have the font for it, you should be able to encode the data
>>> easily enough. No matter what encoding you are using, unless the font
>>> you want to use has a glyph for it, you can't use it. This is more
>>> often the problem I've found.
>>>
>>> Regards,
>>>
>>> Richard.
>>> --
>>> -----
>>> Richard Quadling
>>> "Standing on the shoulders of some very clever giants!"
>>> EE : http://www.experts-exchange.com/M_248814.html
>>> EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
>>> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
>>> ZOPA : http://uk.zopa.com/member/RQuadling
>>>
>>
>>
>>
>> --
>> solo(xzyyyy@gmail.com)
>>
>
> Aha! I see what you mean.
>
> http://www.fpdf.org/en/tutorial/tuto7.htm
>
> Uses an encoding and only allows 256 characters.
>
> Hmm.
>
> With regard to your issue, it sounds like the class is extended
> further or uses magic functions to set/get missing properties.
>
> --
> -----
> Richard Quadling
> "Standing on the shoulders of some very clever giants!"
> EE : http://www.experts-exchange.com/M_248814.html
> EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
> ZOPA : http://uk.zopa.com/member/RQuadling
>
--
solo(xzyyyy@gmail.com)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php