Thursday, March 25, 2010

Re: making fpdf work in cakephp

Thanks! This seemed to work, but now I'm getting this error message,
instead of my index page:

Notice (8): Array to string conversion [APP\vendors\fpdf\fpdf.php,
line 127]

FPDF error: Incorrect orientation: array

Here's the line the error is citing:

$orientation=strtolower($orientation);
if($orientation=='p' || $orientation=='portrait')
{
$this->DefOrientation='P';
$this->w=$this->DefPageFormat[0];
$this->h=$this->DefPageFormat[1];
}
elseif($orientation=='l' || $orientation=='landscape')
{
$this->DefOrientation='L';
$this->w=$this->DefPageFormat[1];
$this->h=$this->DefPageFormat[0];
}

On Mar 24, 6:44 pm, cricket <zijn.digi...@gmail.com> wrote:
> You're using the old syntax. Use App::import('Vendor', 'FPDF');
>
> If that doesn't work, try:
>
> App::import('Vendor', 'FPDF', array('file' => 'fpdf/fpdf.php'));
>
> On Mar 24, 11:20 am, butterlamb <cjwilb...@gmail.com> wrote:
>
> > I've been trying to make fpdf work in CakePHP (http://
> > bakery.cakephp.org/articles/view/pdf-helper-using-fpdf) with no
> > success.
>
> > When I add the pdf helper to the helpers array in my controller, I get
> > the following error message in my view:
> > "Call to undefined function vendor() in...\views\helpers\fpdf.php on
> > line 2."
> > line 2 in my helper is:
> > "vendor('fpdf/fpdf');"
>
> > Would anyone happen to know why I'm getting this error?

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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

To unsubscribe from this group, send email to cake-php+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

No comments: