$this-setColor for PDF helper

2007-08-02 Thread Unite

Dunno if anyone knows here but there proberbaly are lots of people who
do know or used it before.

My problem is that $this-setColor function from a pdf helper isnt
doing what its ment to do. Sometimes it will give the graphics a
colour other times will ignore it and remain white.

Heres a snipit of the code

$this-html2rgb works and has been tested returning 3 values for R G
and B from a HTML hash value.
even when I say $this-setColor(100,100,100,1); the colour doesnt
change.

Basically is there something to reset or iniate the pallete or
setColour that I am supposed to call?

function ezDrawBox($x,$y,$xx,$yy, $data = array(), $values = array())
{
$size=10;
$height = $this-getFontHeight($size);
$width = 0;
$y=800-$y;

if(!empty($data['bg_colour'])) {
$rgb = $this-html2rgb($data['bg_colour']);
$this-setColor($rgb[0],$rgb[1],$rgb[2],1);
$this-filledRectangle($x,$y+$height,$xx,-$yy-$height);

}
if(!empty($data['box_name'])) {
$rgb = $this-html2rgb($data['border_colour']);
$this-setColor($rgb[0],$rgb[1],$rgb[2],1);
$width = $this-getTextWidth($size+1,$data['box_name']);
$this-addText($x+5,$y+9,$size+1,$data['box_name']);
}
if($data['hasborder'] == Yes) {
$rgb = $this-html2rgb($data['border_colour']);
$this-setStrokeColor($rgb[0],$rgb[1],$rgb[2]);
$this-line($x,$y+$height,$x, $y-$yy);
$this-line($x,$y+$height,$x+5,$y+$height);
$this-line($x+5+$width,$y+$height,$x+$xx,$y+$height);
$this-line($x+$xx,$y+$height,$x+$xx, $y-$yy);
$this-line($x,$y-$yy,$x+$xx,$y-$yy);
}

$rgb = $this-html2rgb($data['font_colour']);
$this-setColor($rgb[0],$rgb[1],$rgb[2],1);

for($i=0;$i$data['amt_fields'];$i++)
if(!empty($data['field'.$i])) $this-addText($x+2,($y-5)-($i*9),
$size,$data['field'.$i]);

}


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: $this-setColor for PDF helper

2007-08-02 Thread Samuel DeVore

have you tried the fpdf one?

http://bakery.cakephp.org/articles/view/pdf-helper-using-fpdf

I'm working on updating these articles this weekend.  So if there are
any comments or ideas please send them my way

Sam D

On 8/2/07, Unite [EMAIL PROTECTED] wrote:

 Found out the problem. Helper only seems to know certain colours and
 if it doesnt know the colour makes it white. It is like it only knows
 6 colours. Time to find a new PDF helper. Any advice?


 



-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: $this-setColor for PDF helper

2007-08-02 Thread Unite

I went to the origonal fpdf site and saw wasn't updated since 2004!
Ill have a look through this and see how it goes.

Just a couple questions
1) Can it support RGB from 0,0,0 to 255,255,255
2) Can I effectivly draw things to the PDF ( eg - putPixel(x,y) )
3) Is there documentation with all the functions it can perform on PDF
(eg - $this-SetTextColor() with a description of what it does and
what the fields mean?)

Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---